I think what you are looking at is how the program makes use of functional idioms. And it's simple enough that a functional form isn't wildly different from imperative. But the for/fold ...max construction is higher-level than regular imperative already.