Use TreeMap instead of HashMap