Moved functionality in vector.c around