adding documentation and fixing formatting

Relates to #16. Doesn't completely finish it off though.