convert red black tree to record