HW 4 all works with some flaws