Using while loop, not recursive.