Adding sigmoid function