Add documentation. Slightly change some methods.