added hashing features and fixed some bugs