generate and lookup tokens