SICP exercise solution and some other scheme code