added gradient sampling to the project.  I have not implemented safe checks