aabb testing and transpose functions