added ordering to the output json file