Solution to HW2 completed