added splitvec function