replace map with unordered_map for performance.