This is code that I wrote for  a class at Reed (Math 121)