cython improvement