Added token generation code