Port to Cython finished