update2 for assignment 2