calculation and code changes