private void setDisplayMode() throws LWJGLException{        
        DisplayMode targetDisplayMode = null;
        DisplayMode[] modes = Display.getAvailableDisplayModes();
        int freq = 0;
        
        for (int i=0;i<modes.length;i++) {
            DisplayMode current = modes[i];
            if ((current.getWidth() == Config.WINDOW_WIDTH) && (current.getHeight() == Config.WINDOW_HEIGHT)) {
                if ((targetDisplayMode == null) || (current.getFrequency() >= freq)) {
                    if ((targetDisplayMode == null) || (current.getBitsPerPixel() > targetDisplayMode.getBitsPerPixel())) {
                        targetDisplayMode = current;
                        freq = targetDisplayMode.getFrequency();
                    }
                }
                // if we've found a match for bpp and frequence against the
                // original display mode then it's probably best to go for this one
                // since it's most likely compatible with the monitor
                if ((current.getBitsPerPixel() == Display.getDesktopDisplayMode().getBitsPerPixel()) &&
                    (current.getFrequency() == Display.getDesktopDisplayMode().getFrequency())) {
                    targetDisplayMode = current;
                    break;
                }
            }
        }
        
        Display.setDisplayMode(targetDisplayMode);
        Display.setFullscreen(true);
        Display.setTitle(Config.WINDOW_TITLE);
        Display.create();
        Display.setVSyncEnabled(true);
        
    }