Closed points and discrete valuation rings, Exercise in Ravi Vakil's notes 12.7.B I am working on the problem in Vakil's notes exercise 12.7.B which asks

Suppose $X$ is an irreducible Noetherian separated curve. If $p\in X$
  is a regular closed point, then $\mathcal{O}_{X,p}$ is a discrete
  valuation ring, so each regular point yields a discrete valuation on
  $K(X)$. Use the previous exercise to show that the distinct points
  yield distinct valuations.

I have no problems with the first part. It is the second which I am having problem... 
Given two regular points $p$ and $q$ in $X$ that give the same valuations on $K(X)$, how do I show that they are equal? It says use the previous exercise, which is the easier part of the valuative criterion for separatedness, but I can't find a way to use this to prove that $p$ and $q$ are the same.
So first I start with suppose that the valuations are the same, then $\mathcal{O}_{X,p}=\mathcal{O}_{X,q}:=A$ giving the same function fields $K(A)$. How should I continue from here?
 A: Let $A=\mathcal{O}_{X,p}=\mathcal{O}_{X,q}$. Recall that $K(A)=K(X)$. Set up the usual commutative diagram (my apologies on the formatting- Tikz doesn't work here, and it's the only diagram markup I know) where the top row is 
$$\mathrm{Spec} K(A) \to X$$
and the bottom row is $$\mathrm{Spec} A \to \mathrm{Spec}\mathbb{Z}$$
with vertical morphisms as $\mathrm{Spec}(i)$ (where $i: A\to K(A)$ is the inclusion) and the unique map to $\mathrm{Spec}\mathbb{Z}$. 
The morphism on the top row sends $\mathrm{Spec} K(A)$ to the generic point of $X$, and the morphism on the bottom row is the unique morphism to $\mathrm{Spec}\mathbb{Z}$. $X$ separated is by definition equivalent to the morphism $X\to \mathrm{Spec}\mathbb{Z}$ being separated. 
There are two candidates for maps from $\mathrm{Spec} A\to X$ making the diagram commute: viewing $A$ as $\mathcal{O}_{X,p}$, we can send the closed point to $p$ and the open point to the generic point of $X$; viewing $A$ as $\mathcal{O}_{X,q}$ we can send the closed point to $q$ and the open point to the generic point of $X$. By 12.7A, apply the valuative criteria for separatedness. This says there is at most one map $\mathrm{Spec} A\to X$ making the diagram commute. So our two candidates must in fact be the same map, or $p=q$.
