ex2-5 and ex2-6 (regularization) done