mc: implemented Assignment2.