implementation for segmented vectors
cleaned up header file