Refacto reduce_ranges for performance
Merge pull request #3 from Calyhre/feature_improve_performance

Refacto reduce_ranges for performance