removed valid_ranges (unused variable)