some changes in calculation