code written when reading SICP