added tokenize() function