*            the given required colour bits per pixel of the display mode
	 * @param frequency
	 *            the given required frequency of the display mode
	 * @return the display mode if found, if not found return null
	 */
	public static DisplayMode getDisplayMode(int width, int height,
			int colourBits, int frequency) {
		try {
			// Import all the available display modes
			DisplayMode allDisplayModes[] = Display.getAvailableDisplayModes();
			DisplayMode foundDisplayMode = null;

			// For each available display mode
			for (int displayMode = 0; displayMode < allDisplayModes.length; displayMode++) {
				foundDisplayMode = allDisplayModes[displayMode];

				// Check if it matches the required settings and if it does,
				// return that display mode
				if (foundDisplayMode.getHeight() == height
						&& foundDisplayMode.getWidth() == width
						&& foundDisplayMode.getBitsPerPixel() == colourBits
						&& foundDisplayMode.getFrequency() == frequency)
					return foundDisplayMode;
			}
		}
		// Catches any exceptions thrown by getAvailableDisplayModes()
		catch (Exception exception) {
			System.out.println("KouchKarting.getDisplayMode() error: "
					+ exception);
		}
		// If no compatible display mode was found, return null
		return null;
	}