Performed the calculations