Added documentation, and minor spell checks