hashtable another function
improve memory usage