make this the final return of the buildReg function.