added token-reading feature