Homework 3 for CS 169X