added l1- and l2-regularization