public String toString() {
        String boardstr = "";
        
        String whiteSqr = " .";
        String blackSqr = " ,";

        boardstr += (" X"+"  ");
        for (char file = 'a'; file < 'a'+size.x ; file++) boardstr += (" "+file);
        boardstr += ("  "+" X");
        boardstr += '\n';

        boardstr += ("  "+" +");
        for (int i = 0; i < size.x; i++) boardstr += ("--");
        boardstr += ("-+"+"  ");
        boardstr += '\n';
        
        for (int ty = 0; ty < size.y; ty++) {
            int rank = size.y - ty;

            boardstr += (" "+rank + " |");

            for (int tx = 0; tx < size.x; tx++) {
                if (getPiece(tx, ty) == null) {
                    boardstr += ((tx + ty)%2 == 0 ? whiteSqr : blackSqr);
                } else {
                    String piece;
                    if (getPiece(tx, ty).team.equals("white")) {
                        piece = (getPiece(tx,ty).toString());
                    } else {
                        piece = ((getPiece(tx, ty).toString()).toLowerCase());
                    }
                    boardstr += (" " + piece);
                }
            }

            boardstr += (" |" + " "+rank);
            boardstr += '\n';
        }

        boardstr += ("  "+" +");
        for (int i = 0; i < size.x; i++) boardstr += ("--");
        boardstr += ("-+"+"  ");
        boardstr += '\n';
        
        boardstr += (" X"+"  ");
        for (char file = 'a'; file < 'a'+size.x ; file++) boardstr += (" "+file);
        boardstr += ("  "+" X");

        return boardstr;
    }