some playing around with the gradient function