edited for hw6 p1