Finish basic version of solution.

TODO: Use OOP