Implemented do-while loop