switch to Cython