implements sql tokenizer logic again