final version of assignment 2