working HW2 state