More work on token generator. Not working yet.