private void takeTurn(JTable table) {
        String playersMarker;
        int selectedRow = table.getSelectedRow();
        int selectedColumn = table.getSelectedColumn();
        Point selectedLocation = new Point(selectedRow, selectedColumn);

        Player currentPlayer = this.game.getCurrentPlayer();
        Player otherPlayer = this.game.getOtherPlayer();

        try {

            if (this.game.getGameType() == GameType.ONE_PLAYER) {
                // regular players turn
                Point locationMarkerPlaced = 
                        this.gameCommands.playerTakesTurn(currentPlayer, selectedLocation);
                playersMarker = currentPlayer.getMarker();
                table.getModel().setValueAt(playersMarker, locationMarkerPlaced.x, locationMarkerPlaced.y);
                if (this.gameOver()) { // game won or tied?
                    return;
                }
              
                table.setCellSelectionEnabled(false);
                ListSelectionModel selectionModel = table.getSelectionModel();
                selectionModel.clearSelection();
                

                // computers turn
                locationMarkerPlaced = this.gameCommands.playerTakesTurn(otherPlayer, null);
                playersMarker = otherPlayer.getMarker();
                table.getModel().setValueAt(playersMarker, locationMarkerPlaced.x, locationMarkerPlaced.y);

                if (this.gameOver()) { // game won or tied?
                    return;
                }
                
                


            } else { // two player game
                // regular players turn                
                Point locationMarkerPlaced = this.gameCommands.playerTakesTurn(this.game.getCurrentPlayer(), selectedLocation);
                playersMarker = currentPlayer.getMarker();
                table.getModel().setValueAt(playersMarker, locationMarkerPlaced.x, selectedColumn);
                if (this.gameOver()) { // game won or tied?
                    return;
                }
                
                table.setCellSelectionEnabled(false);
                ListSelectionModel selectionModel = table.getSelectionModel();
                selectionModel.clearSelection();
            }

            if (this.gameOver()) { // game won or tied?
                return;
            }

            String promptNextPlayer = getNextPlayerMessage(this.game.getCurrentPlayer());
            this.jtMessageArea.setText(promptNextPlayer);

        } catch (GameException | Connect4Exception gex) {
            this.jtMessageArea.setText(gex.getMessage());
            ListSelectionModel selectionModel = table.getSelectionModel();
            selectionModel.clearSelection();
        } catch (Exception ex) {
            this.jtMessageArea.setText(ex.getMessage());
            ex.printStackTrace();
            this.dispose();
        }
    }