Homework 6 for Grinnell College csc207 class