tokenize method for separating elements