Hw6 bug corrected