Modify the function get_tokens, implement the rewrite function