for stable output, change to LinkedHashMap. removed stupid code.