Finished regularizer as part of exercise 1.5.