replace ctypes array with cython array