Add documentation, debug