conjugate gradient method bugs fixed