fixes in calculation and typo