making the gradient work by copying earlier homework...not sure I totally understand/remember what I did there