Added some more test inputs.
Cleaned up documentation.
Divided functions into their simplest components.
Separated all logic from the main driver method.