implemented Conjugate Gradients