Massive performance boost to k-ary tree