Change a calculation to use existing functions