Added a bunch of docstring.