Fundamental Lemma Of Geometric Group Theory

I'll be delighted to get some help in understanding the proof of the first theorem here: http://www.math.utah.edu/~malone/QI/notes.pdf "If G acts geometrically on X and Y (proper geodesic metric spaces) then X and Y are quasi-isometric."

In his proof, he fixed $a,b \in X$ and took an arbitrary $q \in Y$ . He then proved that $d_Y (g_0 q , g_n q) \leq R' (d(a,b)+1)$ , which (he claims) finishes the proof.

Can you please explain me how does it implies that X,Y are quasi-isometric?

The definition of Q.I I know is that if we have a map $f:X \to Y$ such that there exist some constants $L,A$ , such that for every $x_1 , x_2 \in X$ , $y \in Y$ : $\frac{1}{L} d(x_1,x_2) -A \leq d(f(x_1) , f(x_2) ) \leq Ld(x_1,x_2) +A$ and $d(y, f(X) \leq A$ .

In the context of that proof, $p$ is a base point for $X$, $q$ is a base point for $Y$, and the function $f : X \to Y$ is defined on each $x \in X$ by first choosing $g \in G$ so that $d(x,gp) \le R$ and then defining $f(x) = gq$. The proof is showing that the function $f$ is a quasi-isometry.