Code and tex files for stat580