Add documentation, clean up whitespace