final version for HW2