added code per assignment instructios