update to selfcal_function to make it more consistent with what I now
know