Improved Collision detection