Figure 2: Flowchart of the calculation algorithm.