change hashmap to linkedhashmap

linkedhashmap returns the keyset in the same order as inserted