final version of the assignment 2