update the section of function compare