Added collision detection and pausing