calculates