collision detection merged