CS193p Assignment 6 Solution