implement tokeniser