Added precise collision detection.