finished implementing assignment 2 question 2