add log fun and replace dic with HashTable