Add test case for calc function
Fix tests
Add calc function
Add doc for calc function