do-while loop formatting fix