changed -1 to a 1 there and then it just moves away from the endstop for a split second and stops.
I tried tinkering with the X_MAX_ENDSTOP_INVERTING and X_MIN_ENDSTOP_INVERTING and that makes it move, but tries to keep going even when hitting the endstop.