public int run()
	{
		int count = 0;
		
		for (int i = 0; i <= MAX_TIME; i++)
		{
			int index = 0;
			
			//remove completed processes at beginning of quanta
			for (int z = 0; z < list.size(); z++)
			{
				SwapProcess sp = list.get(z);
				
				if (sp.isComplete())
				{
					list.remove(sp);
					printSwappedOut(sp, i);
				}
			}
			
			//add new processes at beginning of quanta
			if (alg == "FF")
			{
				while (list.swapInFirstFit(q.peek()))
				{
					SwapProcess gotten = q.remove();
					printSwappedIn(gotten, i);
					count++;
				}
			}
			else if (alg == "NF")
			{
				while (list.swapInNextFit(q.peek(), index))
				{
					SwapProcess gotten = q.remove();
					printSwappedIn(gotten, i);
					index = list.indexOf(gotten);
					count++;
				}
			}
			else if (alg == "BF")
			{
				while (list.swapInBestFit(q.peek()))
				{
					SwapProcess gotten = q.remove();
					printSwappedIn(gotten, i);
					count++;
				}
			}
			
			list.run(); //run all the processes
		}
		
		return count;
	}