compressed some error-prone code, added AABB3