add iterative bash solution