I would give monalin some rep if I could because he is dead-on. A hash map is inherently unordered and has o(1) lookup complexity. You are using the wrong data structure if you need insertion order to be preserved.