extend do-while statement & warning about array index