implemented ToDictionary.