Homework 2 for Berkeley SaaS class