Adding 3-term version of CG; compiles and works