Some exercise code when reading SICP.