I’s always good practice to draw a flow chart before start coding. That will save you lot of debugging problems and the structure and flow of your program will probably be much better than just start coding from the top of your head.
I have tried several drawing programs, some free and some commercial. But this free one is probably one of the best out there.
So if you don’t have any drawing software for making flow charts, take a look at http://www.yworks.com/en/products_yed_about.html
Ps. The software is also available for Mac and Linux