modified calc function