My solution to Homework 3 for CS 61b Fall 2006 UC Berkeley