Made duplicate script more general, now takes collection specifics from command line.