updated collate script