static int freeSpaces(byte[][] in) {

        // It's free if all of them are zero, and their sum is zero.
        boolean c1free = in[0][0] + in[1][0] + in[2][0] + in[3][0] == 0;
        boolean c2free = in[0][1] + in[1][1] + in[2][1] + in[3][1] == 0;
        boolean c3free = in[0][2] + in[1][2] + in[2][2] + in[3][2] == 0;
        boolean c4free = in[0][3] + in[1][3] + in[2][3] + in[3][3] == 0;

        int lfree = 0;
        // Meh, I'm too lazy to code a loop for this.
        if (c1free) {
            lfree++;
            if (c2free) {
                lfree++;
                if (c3free) {
                    lfree++;
                    if (c4free) {
                        lfree++;
                    }
                }
            }
        }

        int rfree = 0;
        if (c4free) {
            rfree++;
            if (c3free) {
                rfree++;
                if (c2free) {
                    rfree++;
                    if (c1free) {
                        rfree++;
                    }
                }
            }
        }

        return lfree * 10 + rfree;
    }