Added wrapper class and flags for the gradient type