Version with separete update function
Added conjugate gradient method. Added multi-class support