work on refactoring collide detection.