Altered Code to fit Assignment Specs