reordering fxns by when they are used

sd_avg_mass and noplacelikehome at the end because we need to find
breakpoints and movment distances first.