changed to cython
added changes to py