working with tokenizer writing token file