adjusted calculations to be more accurate