Added source code in appendix in Main.tex