Cython Improvements

Contians a Python and Cython version of same code