public boolean isItAGoodPieceForTurbo(int lap, int pieceIndex) {
        final int k = 2;
        double piecePowerDefValue;
        if (lastTurboDeficitPieceIndexUpdate != pieceIndex || lastTurboDeficitLapUpdate != lap) {
            lastTurboDeficitPieceIndexUpdate = pieceIndex;
            lastTurboDeficitLapUpdate = lap;
            for (int i = 0; i < powerDeficitsByPieceBuf.length; i++) {
                powerDeficitsByPieceBuf[i].index = i;
                powerDeficitsByPieceBuf[i].value = powerDeficitsByPiece[i].getMedian();
            }
            piecePowerDefValue = powerDeficitsByPieceBuf[pieceIndex].value;
            int from = 0, to = powerDeficitsByPieceBuf.length - 1;
            while (from < to) {
                int r = from, w = to;
                double mid = powerDeficitsByPieceBuf[(r + w) / 2].value;
                while (r < w) {
                    if (powerDeficitsByPieceBuf[r].value <= mid) {
                        IntDouble tmp = powerDeficitsByPieceBuf[w];
                        powerDeficitsByPieceBuf[w] = powerDeficitsByPieceBuf[r];
                        powerDeficitsByPieceBuf[r] = tmp;
                        w--;
                    } else {
                        r++;
                    }
                }
                if (powerDeficitsByPieceBuf[r].value > mid) {
                    r--;
                }
                if (k <= r) {
                    to = r;
                } else {
                    from = r + 1;
                }
            }
        } else {
            piecePowerDefValue = powerDeficitsByPiece[pieceIndex].getMedian();
        }
        if (powerDeficitsByPieceBuf[k].value <= piecePowerDefValue) {
            System.out.println("turbo approved because " + k + " value is " + powerDeficitsByPieceBuf[k].value + "<" + piecePowerDefValue);
        }
        return powerDeficitsByPieceBuf[k].value <= piecePowerDefValue;
    }