add regularization to script