I did I did! If you can see how to rewrite this in a purely functional way, and without making it more complicated or less readable/concise/efficient, then I'd love to see how.