finished tokenizer and tokenhandler, fixed loop and conditionals