repaired box raytracing