private static DisplayMode getBestDisplayMode(GraphicsDevice device)
    {
        // LOOP THROUGH 32 THEN 16 THEN 8 BIT DISPLAY MODES AND SEE WHICH IS THE FIRST ONE WE CAN HANDLE
        for (int x = 0, xn = MODES.length; x < xn; x++)
        {
            DisplayMode[] modes = device.getDisplayModes();
            for (int i = 0, in = modes.length; i < in; i++)
            {
                if (modes[i].getWidth() == MODES[x].getWidth() && modes[i].getHeight() == MODES[x].getHeight() && modes[i].getBitDepth() == MODES[x].getBitDepth())
                {
                    return MODES[x];
                }
            }
        }
        return null;
    }