Ported compute function to cython

Special thanks to Greg Haynes for help porting it
Update docs for cython