docs: function findBestPosition(b, axis) {
        var bestPosition,
            specifiedPosition = new BoxPosition(b),
            percentage = 1; // Highest possible so the first thing we get is better.
  
        for (var i = 0; i < axis.length; i++) {
          while (b.overlapsOppositeAxis(containerBox, axis[i]) ||
                 (b.within(containerBox) && b.overlapsAny(boxPositions))) {
            b.move(axis[i]);
          }
          // We found a spot where we aren't overlapping anything. This is our
          // best position.
          if (b.within(containerBox)) {
            return b;
          }
          var p = b.intersectPercentage(containerBox);
          // If we're outside the container box less then we were on our last try
          // then remember this position as the best position.
          if (percentage > p) {
            bestPosition = new BoxPosition(b);
            percentage = p;
          }
          // Reset the box position to the specified position.
          b = new BoxPosition(specifiedPosition);
        }
        return bestPosition || specifiedPosition;
      }