updated mass_function routine: no need to specify min_mass or max_mass