initial commit: problem 1 solved iteratively