Scheme solution to problem 2

This too can be much more elegant, but it will take some thought and
some added experience with the language.