Documentation

Add some documentation to the existing code.

Fixes #37