cleaned up some more of the function reset code