implemented do-while statement