The fundamental group of the gluing of two genus $g$ $3$-dimensional handlebodies 
I was given the problem above, and I'd appreciate some help. I think I have a general direction, but I'm not entirely sure if what I'm doing is true, so it'd be great if someone could tell me if what I'm doing is generally alright and maybe point me in a more concrete direction if necessary.
So I start off by computing the fundamental group of the genus $g$ handlebody. I do so by taking the handlebody and making it thinner and thinner, until its basically as thick as a line. This is a deformational retract, and therefore not supposed to affect the fundamental group. I'm then left with g copies of $S^1$ which all intersect at a point, and so by the Seifert-Van-Kampen theorem, the fundamental group is the free group generated by $g$ elements.
Now, I want to see what happens when I glue two handlebodies along the boundary. This is where things get tricky for me. I want to use Seifert-Van-Kampen once again, but not entirely sure that I'm doing it correctly. Since I glue the to handlebodies along the boundary, the intersection of the two handlebodies is now a sufrace of genus $g$, who's fundamental group I can once again calculate using Seifert-Van-Kampen - 
$$\pi=\langle a_1,b_1,...,a_g,b_g| \prod _{i=1}^{g} [a_i,b_i]=1 \rangle$$
So I think that the fundamental group I'm looking for should be the free product of the two original fundamental groups of the handlebodies ($F_1, F_2$), under quotient with respect to the fundamental group of the surface with genus $g$ :
$$\pi'=(F_1*F_2)/\pi$$
Does this make sense? Or is there something I'm missing along the way? Moreover, I'm wondering if there's a simpler/clearer way to express the group $\pi'$.
Thanks in advance.
 A: This make sense, but there is a bit of work left. You have to see what the quotient 
$$\pi^\prime=(F_1*F_2)/\pi$$ 
is. Written like this it doesn't really make sense because $\pi$ isn't a subgroup of $F_1*F_2$. Let 
$$i_1:\pi\to F_1\quad\text{and}\quad i_2:\pi\to F_1$$ 
be the homomorpshim induced by inclusion, and let 
$$j_1:F_1\to F_1*F_2\quad\text{and}\quad j_2:F_2\to F_1*F_2$$
be the natural inclusions.
If $H$ denotes the normal subgroup of $F_1*F_2$ generated by the elements $$j_1\circ i_1(p)\cdot(j_2\circ i_2(p))^{-1}$$ 
for $p\in \pi$ then we have 
$$\pi'=(F_1*F_2)/H.$$ 
Now we have to understand what $i_1$ and $i_2$ do to elements of $\pi$. Write $F_1=\langle c_1,\dots,c_g\rangle$ and $F_2=\langle d_1,\dots,d_g\rangle$. If you choose the generator $c_k$ and $d_k$ in a good way, you get $i_1(a_k)=c_k$ and $i_1(b_k)=1$, and similarly $i_2(a_k)=d_k$ and $i_2(b_k)=1$. To see this just do a drawing and understand what the loops $a_k$ and $b_k$ become in each handle-bodies.
Finally you get 
$$\pi^\prime=\langle c_1,\dots,c_g,d_1,\dots,d_g~\vert~c_1d_1^{-1}=\dots=c_gd_g^{-1}=1\rangle$$
so $\pi^\prime$ is just a free group with $g$ generators.
I can't thing of a better way to solve this problem. I hope this helps!
