Adding in toSortedDict and toDict