start implementing gradient
misc
misc
conflict resolved