added token function prototype