Added a whole lot of documentation.