public double timeLengthRank(double percentage) 
	{
		boolean cutOffNotOkay=true;//determines if cut off is appropriate
		Collections.sort(library,TimeLengthComparator.getTL());
		double percentageOfMean=percentage*1.5;
		while(cutOffNotOkay)
		{
			int count=0;
			double cutoff= tlMean *percentageOfMean; // the cut off is a certain percentage of the mean
			for(int i=0;i<library.size();i++)
			{
				if(library.get(i).getTimeLength()<cutoff)
				{
					library.get(i).setTLRank(library.size());
					count++;
				}
					
				else
					break;
			}
			
			int rank=1;
			if(count<oneCount*1.65) // the number of songs below the cut off should be in between 1.15 and 1.65 times the number of songs that by default will be
			{
				if(count>oneCount*1.15)
				{
					library.get(count).setTLRank(rank);
					for(int i=count+1;i<library.size();i++)
					{
						if(library.get(i).getTimeLength()>library.get(i-1).getTimeLength())
						{
							rank++;
							library.get(i).setTLRank(rank);
						}
						else
							library.get(i).setTLRank(rank);	
					 }
					
					cutOffNotOkay=false;
					
				}
				
				else
					percentageOfMean=percentageOfMean+0.025; // the % was too small
						
			}
			
			else
				percentageOfMean=percentageOfMean-0.025; // the % was too big
		}
		
		return (percentageOfMean/1.5);
		
		
	}