diff --git a/Makefile b/Makefile
index ed241ac1fedda9afbc97dba33d0a72dd57d2491d..14f07cfa74f18d7d94371c36305c52aa87a438a6 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ MAINTEXFILE = main.tex
 TEXFILES = ${MAINTEXFILE}
 SAGETEXSCRIPT = main.sagetex.sage
 
-main.pdf: ${TEXFILES}  main.sagetex.sout
+main.pdf: ${TEXFILES}  main.sagetex.sout filtered_sage.txt
 	latexmk
 
 main.sagetex.sout: ${SAGETEXSCRIPT} ${PYPLOTFILES}
diff --git a/main.tex b/main.tex
index d5d6d1a4e381210a3713b56e58346f761933c457..ce71a2198de15d5a752f2cec052cdfc063629fc9 100644
--- a/main.tex
+++ b/main.tex
@@ -284,4 +284,34 @@ In the case $\beta = \beta_{-}$ (or $\beta_{+}$) this can be simplified.
 
 \section{Conclusion}
 
+\section{Appendix - SageMath code}
+
+\definecolor{codegreen}{rgb}{0,0.6,0}
+\definecolor{codegray}{rgb}{0.5,0.5,0.5}
+\definecolor{codepurple}{rgb}{0.58,0,0.82}
+\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
+
+\lstdefinestyle{mystyle}{
+  backgroundcolor=\color{backcolour},   
+  commentstyle=\color{codegreen},
+  keywordstyle=\color{magenta},
+  numberstyle=\tiny\color{codegray},
+  stringstyle=\color{codepurple},
+  basicstyle=\ttfamily\footnotesize,
+  breakatwhitespace=false,         
+  breaklines=true,                 
+  captionpos=b,                    
+  keepspaces=true,                 
+  numbers=left,                    
+  numbersep=5pt,                  
+  showspaces=false,                
+  showstringspaces=false,
+  showtabs=false,                  
+  tabsize=2
+}
+
+\lstset{style=mystyle}
+
+\lstinputlisting[language=python]{filtered_sage.txt}
+
 \end{document}