Removed bottleneck when inserting into tree