Adding tanh non-linearity