optimized collision checker