A more functional-style Dylan Version of Problem 1