Documentation and minor code cleanup
fixes #250