Calculation of values (a and b)