Moved to SortedDictionary

This has not yet been tested.