started a python version of calculate