range lookup implementation to be change and made similar to sorting implementation