Rewrite of the iteration algorithm