Replace while (iter < max_iter) with for cycles
Update TODO