collisions in python