regularization for logistic regression cost fcn and tests