small change in logic for calculations