<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def incrementName(nameList, name):
 """ return a name that is unique in a given nameList through attaching a number to it now we will add 3xfoo 2xbar and one klaus to our list: ['bar', 'bar2', 'foo', 'foo2', 'foo3', 'klaus'] """

    if name not in nameList:
        return name
    newName = name + str(1)
    for n in range(1, len(nameList) + 2):
        found = False
        for b in nameList:
            newName = name + str(n)
            if b == newName:
                found = True
        if not found:
            break
    return newName