Homework for http://www.cis.upenn.edu/~cis194