basic CG method.