Cleaned up nextMovement and fixed the depth change direction.