Added initial version of possible solution.
Fixed a few bugs with the implementation.
Added some code for testing.
Updated README.md.