Added documentation.

It's not entirely finished, but the main body is there for you to understand how the class works.'