refined function to calculate zipcodes in range