Calculations are not working properly