EDIT: Fixed bug in the logic of sicp 1-3