Removed some unneeded code, replaced while loops with single for loop
Changed name of boolean list, removed test code