add cython implementation of iterative algorithm