public int count(int x) throws Exception {
        int count = 0;
        if (this.array.length == 0) {
            throw new Exception();
        }
        for (int[] temp : this.array) {
            if (temp.length == 0) throw new Exception();
            for (int aTemp : temp) {
                if (x == aTemp) count++;
            }
        }
        return count;
    }