change generator to reader and use map for csv