Stanford Programming Assignment 1