Something approaching working for HW5