Implemented most of the tokenizer