Simplfied script once I realized I had been taught how to add to a hash
Also formatted output, changed to using $count for the while loop