reworked backend to work with both RTrees and flattend DUALTrees