HW3..+ functions