replaced for loops with do while