Calculations inside of my form are not working correctly