Implements AABB trees, huge boost to performance