Add documentation, logging