Documentation and top level routine