implements Programming Assignment 1