Starting the calculation algorithm