Geometry math question no Guessing and Please show work thank you

A, B and C are collinear and B is in the middle.
so we have AB + BC =AC
6x +x-5= 23
7x -5=23
adding 5 to both sides
7x=23+5
7x =28
dividing both sides by 7
we get x=28/7 =4
So answer is x=4