Optimized collisiondetection a bit.