Programming assignment 2 solved.