added \end{document} and other stuff