public boolean hasFlag(int flags, int flag) {
		boolean hasFlag = false;
		boolean finished = false;
		int waarde = 1024;
		int newFlag = flags;
		while (!finished) {
			newFlag -= waarde;
			if (waarde < flag) {
				finished = true;
			} else {
				if (newFlag <= 0) {
					if (waarde == 1) {
						finished = true;
					}
					newFlag = flags;
					waarde /= 2;
				} else {
					flags = newFlag;
					if (waarde == flag) {
						hasFlag = true;
						finished = true;
					} else {
						waarde /= 2;
					}
				}
			}
		}
		return hasFlag;
	}