expand_by function

Expands a vector