ADDED movementHandler now works correctly with wall detection