patched price_ranges.py for edge cases