Imperative To Functional Programming