added token parsing