HW6 with minor error!