1.Working issue #35, partial solution still needs to be tested.
2.Possibly refactor quite a bit of code duplication should be okay though not sure if worth putting into private function.
1. Added #include <iostream> for basic testing.
2. It compiles!