Changed tick() to update the x-positions properly