surplus calculation