Programming Assignment 2 solutions