calc function passes its unit tests