Modified the yvec and xvec building to produce fewer errors