use a map, don't know how to use hash map in C++, but it works