added regularization term to weight estimation.