add iterative solution