smaller changes to collision detection

made some minor changes that cleaned up the code.