adding documentation to vector.c and fixing some bugs along the way