minor adjustment of gap detection factor