Answer to Programming Assignment 2