edit the code for assignment2