Add documentation, clean up