changing HashMap to LinkedHashMap to preserve ordering