Added horizontal movement and collision detection