Conditions aren't adding up calculations properly