Working on Cythonification of the code