need to fix derivative for tanh