wrote buildvectors (somewhat inefficiently)