Changed logic and scope of calculation