Added JSON output to collate method.