private static void reflectAxis(int[][] array, int size, boolean axis) {
        int temp;
        if (axis) {
            for (int i = 0; i < size*size; i++) {
                for (int j = i + 1; j < size*size; j++) {
                    temp = array[i][j];
                    array[i][j] = array[j][i];
                    array[j][i] = temp;
                }
            }
        } else {
            int S = size * size;
            for (int i = 0; i < size*size; i++) {
                for (int j = 0; j < S - 1 - i; j++) {
                    temp = array[i][j];
                    array[i][j] = array[S - 1 - j][S - 1 - i];
                    array[S - 1 - j][S - 1 - i] = temp;
                }
            }
        }
    }