added tokenize function