private static boolean[][] truncate(boolean[][] polyomino){
        boolean[][] newP = new boolean[polyomino.length-1][polyomino.length-1];
        boolean left=false;
        for (int i=0; i<polyomino.length; i++){
            left = left || polyomino[0][i];
        }
        boolean top=false;
        for (int i=0; i<polyomino.length; i++){
            top = top || polyomino[i][0];
        }
        int x=left?0:1;
        int y=top?0:1;
        for (int i=0; i<newP.length; i++){
            System.arraycopy(polyomino[i+x], y, newP[i], 0, newP.length);
        }
        return newP;
    }