@Override
    public void actionPerformed(ActionEvent event) {
        int pos[]   = getPos(event.getActionCommand());
        int delta[] = {selection[0], selection[1]};

        int i;

        if(isSelection) {
            if(pos[0] == selection[0] && pos[1] == selection[1]) {
                unselectAll();
                if(findMoveable() == false)
                    selectPlayerMovement();
            } else {
                if(state[pos[0]][pos[1]] == -P[playerTurn]) {
                    killToken(pos[0],pos[1]);
                    for(i = 0; i < 2; i++) {
                        delta[i] -= pos[i];
                        delta[i] *= -1;

                        pos[i] += delta[i];
                    }

                    move(selection[0], selection[1], pos[0], pos[1]);
                    if(isMoveable(pos[0], pos[1])) {
                        unselectAll();
                        select(pos[0], pos[1]);
                    } else {
                        flipTurn();
                        unselectAll();
                        if(findMoveable() == false)
                            selectPlayerMovement();
                    }
                } else {
                    move(selection[0], selection[1], pos[0], pos[1]);
                    flipTurn();
                    unselectAll();
                    if(findMoveable() == false)
                        selectPlayerMovement();
                }
            }
            isSelection = false;
        } else {
            selectPossibleMovement(pos[0], pos[1]);
            isSelection = true;
        }

        selection[0] = pos[0];
        selection[1] = pos[1];
    }