Reimplement normalize_tokens, use a tmp array to make it more clear, by the way, make a strict array in rules.