Did some more testing

The program should run fine now. You guys should it yourselves to make
sure and make it more efficient if possible. I added comments to some of
the changes I made.