populate next right pointers in each node