This whole for loop seems very inefficient. Why recreate a new vector. You already have one (trackers) and you only need to find the index of the tracker you wish to replace and update that index in the vector.