Fixed bug on line 102 with while loop.