change hashtable to SortedDictionary