updated implementation of RNNs
fixed test_rnn error