writing the first version of legendre.tex