sicp: added exercise 3.24