switch statement for tokenizer