hw9 direct code