When I tested the new function in the REPL, it returned the results in reverse order. I told chatGPT about the problem, and it obliged. Further testing in the REPL confirmed that the new function is correct.