added code to collate an arbitrary set of files