minor optimization to collision detection