sketched out implementation of rnn