Programming Assignment 2 source code