Added lots of documentation.