update tokenization function