debugged tokenizer and parser