modified to be more inline with existing masterupdate script