added code for cs520 lab7