Collision detection implemented.