add integral main function