Working Solution HW3 Q6