Added CostFunction for regularized least squares