bug fix for hw3 pt2