Use unordered_map for the incoming and generated lists.