So basically, the bug was that if you dragged the ball off screen, it would go back to the place it was before you dragged it, but the x position and y position would stay at the place you dragged it too.