Calculation Algorithm

I have been working on the calculation algorithms.  There are two changes: