public static String generateID(Person activeP, List<Person> a) {
		if (activeP.getLastName() == null || activeP.getFirstName() == null) {
			System.out.println("generateContestantID: first or last name null");
			return new String();
		}

		ArrayList<String> ids = new ArrayList<String>(a.size());
		for (Person p : a)
			if (p.getID() != null)
				ids.add(p.getID());

		String newID;
		String lastName = activeP.getLastName().toLowerCase()
				.replaceAll("\\s+", "");
		String firstName = activeP.getFirstName().toLowerCase();
		int lastSub = Math.min(6, lastName.length());
		int num = 0;
		boolean valid = false;

		do {
			// take the first letter of first name
			// take substring of lastName length 6 or full name
			newID = firstName.charAt(0) + lastName.substring(0, lastSub);
			if (num != 0) {
				newID += Integer.toString(num);
			}
			num++;

			valid = true;
			for (String id : ids)
				if (id.equalsIgnoreCase(newID)) {
					valid = false;
					break;
				}
		} while (!valid); // check if the ID is present

		return newID;
	}