def METHOD_NAME(currentState,nextState):
    updated = 0
    vault = ptVault()
    entry = vault.findChronicleEntry(kLogTrackVarname)
    if entry is not None:
        state = entry.getValue()
        if state == currentState:
            avatar = PtGetLocalAvatar()
            worn = avatar.avatar.getAvatarClothingList()
            currentgender = avatar.avatar.getAvatarClothingGroup()
            if currentgender == kFemaleClothingGroup:
                clothingName = "02_FTorso11_01"
            else:
                clothingName = "02_MTorso09_01"
            itsThere = 0
            for item in worn:
                if item[0] == clothingName:
                    itsThere = 1
            if itsThere:
                entry.setValue(nextState)
                entry.save()
                updated = 1
                PtDebugPrint("updated to %s" % (nextState))
            else:
                PtDebugPrint("no track")
        if not updated:
            # ha, ha ...start over
            PtDebugPrint("not updated")