Moduli of curves via algebraic geometry