Rearranging, new calc_g funcs
Have all functions setup for unity integration testing