Added calc function.