rewritten problem-007.scm