working vector_copy, although it can be improved