public ArrayList<Integer> getValidMoves(int player) {
        ArrayList<Integer> playerPieces = findPlayerPieces(player);
        ArrayList<Integer> legalMoves = new ArrayList<Integer>();
        for (Integer playerPiece : playerPieces)
            legalMoves = findLegalMoves(playerPiece, player, legalMoves);
        Collections.sort(legalMoves);
        return legalMoves;
    }