update documentation of main function