merge an avl list implementation (imported from PacketBB)