Programming assignment 2 for coursera