I'm having trouble understanding Corollary 1.28 of Hatcher which proves that for every group $G$ there is a space $X_G$ such that $\pi_1(X_G)=G$.
Since $G$ is the quotient of a free group $F$, we have some map $\varphi\colon F\to G$ with kernel $K$. Let $g_\alpha$ be the generators of $F$, and $r_\beta$ the generators of $K$. He gets $G=\langle g_\alpha\mid r_\beta\rangle$ is a presentation of the group. I follows this so far.
Then the construction follows by attaching $2$-cells $e_\beta^2$ to the wedge $\bigvee_\alpha S^1_\alpha$ by the words specified by $r_\beta$. I don't get why attaching the $2$-cells in this ways makes things work out.
There is a proposition on the preceding page that says the inclusion $X\to Y$ induces a surjection $\pi_1(X,x_0)\to\pi_1(Y,x_0)$ with kernel the space generated by all loops $\gamma_\alpha\varphi_\alpha\gamma_\alpha^{-1}$ for varying $\alpha$, where $\gamma_\alpha$ is a path from $x_0$ to $\varphi_\alpha(s_0)$ for each attaching map $\varphi_\alpha$ of $e_\alpha^2$.
So I assume the specific case here is that the inclusion $\bigvee_\alpha S^1_\alpha\to X_G$ leads to an isomorphism $\pi_1(X_G)\simeq\pi_1(\bigvee S^1_\alpha)/N$. I know $\pi_1(\bigvee S^1_\alpha)\simeq F$, but I can't see why the $N$ generated by the loops should be the same as $K$ generated by the words to get the desired isomorphism.