Cythonized and upgrades