Fixed up comments and added documentation.