Solution for HW2