added sigmoidGradient function