Assignment 11 -- lots of loops