public double lru()
	{
		if(printAll)
			System.out.println("~~~~~ Least Recently Used ~~~~~");
		
		int hits = 0;
		Page evictedPage;
		int prevPageRef = -1;
		int nextPage;
		
		for(int i=0;i<PAGE_REFERENCES;i++)
		{
			evictedPage = null;
			nextPage = nextReference(prevPageRef);
			prevPageRef = nextPage;
			
			for(int index=0;index<memory.size();index++)
				memory.get(index).incrementTimeSinceUsage();
			
			//Print time since last usage
			//for(int x=0;x<memory.size();x++)
			//	System.out.printf("%d: %d\n", memory.get(x).getIndex(), memory.get(x).getTimeSinceUsage());
			
			if(!pageInMemory(nextPage))
			{
				//Add page into memory
				if(memory.size() != MEMORY_SIZE)//Is memory full?
				{//No
					memory.add(program.get(nextPage));
				}
				else
				{//Yes
					Collections.sort(memory, Page.recentComparator());
					Page page = program.get(nextPage);
					evictedPage = memory.remove(0);
					memory.add(page);
				}
			}
			else
				hits++;
			
			if(printAll)
			{
				printMemory();
			
				if(evictedPage != null)
					System.out.printf("   Page Referenced: %d | Page %d evicted\n", nextPage, evictedPage.getIndex());
				else
					System.out.printf("   Page Referenced: %d | No eviction\n", nextPage);
			}
		}
		
		resetProgram();
		memory.clear();
		if(printAll)
			System.out.println();
		
		return (double) hits / (double) PAGE_REFERENCES;
	}