add range source file
add range specification file
add min source file
add min spec file
refactor code in these files
refactor sortby logic