Working version of Program Assignment 2