Programming Assignment2 Solution