Added tokenize function