changing SortedMap to TreeMap in order to work around what I think is a compiler bug in 2.10.0