adds methods for gradient calculations