edit updateXMovement method