Refactored MoveOffWall() code
Fixed the previous refactoring