Related to the classification theorem for compact surfaces I am reading Massey's Algebraic Topology: An Introduction. Theorem 5.1 (the classification theorem for compact surfaces) of chapter 1 has a couple of steps. The whole proof is algorithmic. In the first step, the triangulation of a compact surface is given (without the proof of the existence). I understand the whole proof/algorithm except the claim of step 3 of the proof.
In step 3, the author says we can transform our polygon such that all vertices are identified to a single point. At some point in the proof of this step, he says that we can completely eliminate a class of vertices. (By the way, the vertices are to be equivalent iff they are to be identified.)
Can anyone please explain how we can eventually eliminate a certain class of vertices? Thank you so much. 
 A: Let me use $P$ to denote the polygon. Suppose also that there are two or more equivalence classes of vertices. It follows that if you start at one vertex and then walk one at a time around the vertices of $P$, there must exist two consecutive vertices $V_1,V_2$ which are in different classes. Let $E$ be the edge of $P$ having endpoints $V_1,V_2$. This edge $E$ is identified with some other edge that I'll denote $E'$. Under the identification of $E$ with $E'$, $V_1$ is identified with one endpoint of $E'$ denoted $V'_1$, and $V_2$ is identified with the opposite endpoint of $E'$ denoted $V'_2$. The vertices $V_1,V_2$ are in the same class, and the vertices $V'_1,V'_2$ are in the same class which is different from the $V_1,V_2$ class.
Now alter $P$, taking a quotient by collapsing $E$ to a point and simultaneously collapsing $E'$ to a point, producing a new polygon $P'$ with two fewer sides, and the side pairing of $P$ induces a side pairing of $P'$ which produces the same surface (there's something to think about to convince yourself that it produces the same surface up to homeomorphism). 
Of key importance is that this operation has the effect of reducing the number of equivalence classes of vertices by $1$: the $V_1,V_2$ class and the $V'_1,V'_2$ class have been merged into a single class; and the other equivalence classes of vertices remain intact.
For an example of this, take a regular hexagon in the plane and glue each pair of parallel sides, choosing the gluing map to be the Euclidean translation. Check that there are exactly two equivalence classes of vertices, with 3 vertices in each class, and the endpoints of each edge being in different classes. You may now choose any one of the opposite side pairs to be $E$ and $E'$, and you may take a quotient by simultaneously collapsing $E$ and $E'$ to get a square. You may then check that the induced gluing on that square is the standard gluing for a torus.
