Took out while loop bug