update and completed Assignment2