optimized Collision-detection