HW4 Complete (an attempt)