Implemented Assignment 2.