Optimizes collision detection