use new hash map to simplify data structure