Updated the move() function