Functional Program

Now functional! Is it functional with more than one test file? One can
only hope… Anyway! More optimizations coming soon, as well as some more
commenting