moved binning funcs to common and separated the dmin etc into a get_stats() function that is only called when -no is not present