started grad function
added find nearest gradient algorithm
old gradient function added back for git
old gradent function removed again
fixed merge conflicts