Added buildvocab and vector functions