New function for token_list and logic judge