work on nextcollision method