added functionality to draw stellar masses from a powerlaw mass function
modified to include stellar mass function