add regularization term & improve import