public static Result preemptiveHighestPriorityFirst(FutureStack future, int duration)
	{
		//Implemented with RR
		
		String result = "";
		int time;
		ArrayList<Process> active;
		ArrayList<Process> completed = new ArrayList<Process>();
		
		//Set up priority queues
		ArrayList<ArrayList<Process>> priorityQueues = new ArrayList<ArrayList<Process>>();
		priorityQueues.add(new ArrayList<Process>());
		priorityQueues.add(new ArrayList<Process>());
		priorityQueues.add(new ArrayList<Process>());
		priorityQueues.add(new ArrayList<Process>());
		
		for(time = 0; time <= duration; time++)
		{
			Process process;
			char proc;
			//Process is arriving, add it into the proper queue
			while(future.hasActiveProcess(time))
			{
				process = future.pop();
				priorityQueues.get(process.getPriority() - 1).add(process);
			}

			//Active will be set to the highest priority queue with a Process
			active = null;
			for (int i = 0; i < priorityQueues.size(); i++) {
				if (!priorityQueues.get(i).isEmpty()) {
					active = priorityQueues.get(i);
					break;
				}
			}
			
			//Start preemptive HPF starts here
			if(active != null) 
			{
				proc = active.get(0).getName();
				if (active.get(0).process(time))
					completed.add(active.remove(0).setCompletion(time + 1));
				else
					//removes the process that just ran, and puts it in the back
					active.add(active.remove(0));
			} 
			else 
			{
				proc = '-';
			}
			result += proc;
			//End Preemptive HPF
		}
		for (ArrayList<Process> list : priorityQueues)
			for (Process p : list)
				if (p.getFirstProcessTime() != -1)
					completed.add(p);
		return analyzeCompletion(result, completed, duration);
	}