Please don't edit your posts after you get an answer (at least not vital parts).
Eri523 gave you a good link regarding the do-while