cleaning up collision detection