Regularization added in the end of the script.