public int[] getUtility( int [] utility,boolean isMax)//might be problem here
	{
		int [] result=new int [2];
		int curr=utility[0];
		if(isMax)//find the max value in utility
		{
			for(int i=1;i<utility.length;i++)
			{
				if(utility[i]>curr){
					curr=utility[i];
					result[1]=i;
				}
			}
		}
		else
		{	
			for(int i=1;i<utility.length;i++)
			{
				if(utility[i]<curr){
					curr=utility[i];
					result[1]=i;
				}
			}
		}
		result[0]=curr;
		
		return result;
	}