fixed bug in conjugate gradient; added linear equation solver based on cgd