Programming assignment #2 of coursera