Code for CS193P Assignment 5