Change to red-black tree for beam