Slight improvement

Better heuristic for gap sizes improved speed, but it still needs some
work because its affecting the results.