codes for SICP exercises