uses complex javascript to generate a token
