Assignment2 final version