Made edits suggested by Miguel and finished the appendix.