Changed data structure from hash map to a list and pretty printed the JSON with sorted keys