compressed the calculation case switch