Modified for HW4 part 1