tokenizer as a writable stream
fixing a bug
cleaning up a little bit