Finish exercise 1.29, 1.30, 1.31