use hash_map to improve speed but need more momenry