collision detection and resolution fully added does not quite work right