added cython code