Implemented the move operation