Add documentation, cleanup