modified: problem-042.scm, shorter and faster