Added documentation.
Fixed a little bug.