Exercise 2.1 of SICP done