Add a function for duplication of a vector