One thing that is confusing is the "target" variable is not a "target", but rather the "source". I recommend changing the name to "files" or something that makes more sense.