better tokenizer and fixed docstring