Finish Exercise 2.46, 2.47, 2.48, 2.49, 2.50 and 2.51