main function changes