small changes in rnn and tree