Moved newvec into main code.