In future, please use highlight tags around your code (see my sig), and proper formatting is encouraged.
I have done it for you this time.

This infinite loop is caused by your while loop.

You...