improving collision detection