updated for HW2, part 2