Added hasGradient variable