reference vector is now the same type as target to eliminate warnings about comparing signed and unsigned integers