collision detection and loss conditions complete