add backpointers for forward backward