So first we need to keep a reference to the latest face that was collected for each person. We'll do this by updating the m_latestFaces array of integers, which just stores the array index of each person, from the big preprocessedFaces array (that is, the collection of all faces of all the people). As we also store the mirrored face in that array, we want to reference the second last face, not the last face. This code should be appended to the code that adds a new face (and mirrored face) to the preprocessedFaces array as follows: