step 6 - collision detection