public TreeSet<Assign> extractBest(int num, TreeSet<Assign> used) {
		
		// Sanity check
		assert num <= numLectures : "Attempting to extract more assignments than possible";
				
		HashMap<String, Assign> fixedAssignments = (HashMap<String, Assign>)environment.getFixedAssignments();
		TreeSet<Assign> bestAssignments = new TreeSet<Assign>();
				
		// We want to start with the first assignment, i.e. the best one
		for (int count = 0, index = 0; count < num && index < numLectures; ++ count) {
			
			Assign best = rankedAssignments.get(index);
			
			// Make sure we're not grabbing a fixed assignment or an assignment for a lecture which has already been assigned, and also that we don't go out of bounds
			while (fixedAssignments.values().contains(best) && used.contains(best) && index < numLectures) {
				best = rankedAssignments.get(index);
				++index;
			}
						
//			System.out.println("Adding " + best.getName() + "," + best.getSession().getName());
			
			// Add the assignment to our set
			bestAssignments.add(best);
			
			// Increment our index
			++index;
		}
		
		return bestAssignments;
	}