adding update and tokenize functions