made the generator code more concise, converted file storage from pickle to CSV