Exercise 2-9 from the book
Exercise 2-10 from the book