Added a lot more documentation.