Programming Assignment 2 - final version