The code works, but it winds up freezing the program...

Printable View