I am trying to understand some single steps in this recap of Bernhard Riemann's original proof by Alexandre Eremenko that the moduli space $M_g$ of compact Riemann surfaces with genus $g \ge 2$ has dimension $3g-3$ (or in original context the $3g-3$ 'degrees of freedom' are what Riemann called 'moduli')
Riemann combines what is called Riemann-Roch and Riemann-Hurwitz nowadays. He considers the dimension of the space of holomorphic maps of degree $d$ from the Riemann surface of genus $g$ to the sphere. He computes this dimension in two ways. By Riemann-Roch this dimension is $2d-g+1$, for a fixed Riemann surface. (Indeed, Riemann-Roch says that the dimension of the space of such functions with $d$ poles fixed is $d-g+1$ (when $d\geq 2g-1$ which we may assume), but these poles can be moved, so one has to add $d$ parameters).
On the other hand, such a function has $2(d+g-1)$ critical points by Riemann-Hurwitz. Generically, the critical values are distinct, and can be arbitrarily assigned, and this gives the dimension of the set of all such maps on all Riemann surfaces of genus $g$.
So the space of all Riemann surfaces of genus $g$ must be of dimension $$2(d+g-1)-(2d-g+1)=3g-3.$$
There are essentially two things I struggle with.
Point 1: Why the dimension of the space of holomorphic maps of degree $d$ from the Riemann surface $S$ of genus $g$ to the sphere equals $2d-g+1$?
As far as can follow we are going to apply RR. Let $h$ any holomorphic map $S \to \mathbb{P}^1$ of degree $d$ which we regard as meromorphic function $h$ which behaves compatible with degree $d$ in it's poles and zeros, set $(h) :=D$ and apply RR to it. RR tells $l(D)= d -g+1$ where $l(D)$ is the $C$-dimension of meromorphic functions $f$ on $S$ such that all the coefficients of the divisors $(f) + D$ are non-negative.
Eremenko argues then that the additional $d$ dimensions we obtain because 'the poles of can be moved, so one has to add $d$ parameters.'
I not understand why moving of the $d$ poles gives additionally exaxt $d$ parameters.
Point 2: Why the difference
$$ 2(d+g-1)-(2d-g+1) $$
between the number of critical points of these moromorphic functions (that's Riemann-Hurwitz-Thm) and the counted dimension of the space of holomorphic maps of degree $d$ from point 1 gives exactly the dimension of the moduli?