working on 2-39 sicp