University of California at Berkeley CS168, Homework 2