changed hashmap to tree map

helps with ordering