sclass ChessOCR_BoardsFound { sclass ByFEN { double bestScore; Set> boardPositions = synchroSet(); } Map byFEN = synchroMap(); void add(ChessOCR_RecognizedBoard b) { if (b == null || b.fen == null) ret; ByFEN bf = getOrCreate ByFEN(byFEN, b.fen); bf.bestScore = max(bf.bestScore, b.score); if (b.rectInOriginalImage != null) bf.boardPositions.add(pair(b.rectInOriginalImage, b.score)); } }