added function for functionality to calculate ranges of a maximum size