final version of Assignment 2