added more arguments; added hashing function; switched to c++11 unordered containers