Modified for HW5 Part1