adding d&g to grad descent but struggling to make much sense; discussed code a bit