Assignment 2 implemented