do some exercise for chapter 2; but I removed 5 and 7 wrongly :(