Fixed typo that got global variable instead of object attribute.
Added basic autodocumentation.
Added much needed docstrings.