trim_vec function

Trim the tailing zeroes from a long vector