Using BTreeMap instead of now-removed TreeMap.