Add correct code for collision detection.