Finished merging and saving back to NAS.  Updated code by joelfred.