public void init(Properties p, Vector<Integer> members) throws WorkloadException
	{	

		//sessions
		double getownprofileproportion=Double.parseDouble(p.getProperty(GETOWNPROFILE_PROPORTION_PROPERTY,GETOWNPROFILE_PROPORTION_PROPERTY_DEFAULT));
		double getfriendprofileproportion=Double.parseDouble(p.getProperty(GETFRIENDPROFILE_PROPORTION_PROPERTY,GETFRIENDPROFILE_PROPORTION_PROPERTY_DEFAULT));
		double postcommentonresourceproportion=Double.parseDouble(p.getProperty(POSTCOMMENTONRESOURCE_PROPORTION_PROPERTY,POSTCOMMENTONRESOURCE_PROPORTION_PROPERTY_DEFAULT));
		double delcommentonresourceproportion=Double.parseDouble(p.getProperty(DELCOMMENTONRESOURCE_PROPORTION_PROPERTY,DELCOMMENTONRESOURCE_PROPORTION_PROPERTY_DEFAULT));
		double acceptfriendshipproportion=Double.parseDouble(p.getProperty(ACCEPTFRIENDSHIP_PROPORTION_PROPERTY,ACCEPTFRIENDSHIP_PROPORTION_PROPERTY_DEFAULT));
		double genfriendshipproportion=Double.parseDouble(p.getProperty(GENERATEFRIENDSHIP_PROPORTION_PROPERTY,GENERATEFRIENDSHIP_PROPORTION_PROPERTY_DEFAULT));
		double rejectfriendshipproportion=Double.parseDouble(p.getProperty(REJECTFRIENDSHIP_PROPORTION_PROPERTY,REJECTFRIENDSHIP_PROPORTION_PROPERTY_DEFAULT));
		double unfriendfriendproportion=Double.parseDouble(p.getProperty(UNFRIEND_PROPORTION_PROPERTY,UNFRIEND_PROPORTION_PROPERTY_DEFAULT));
		double unfriendacceptfriendshipproportion=Double.parseDouble(p.getProperty(UNFRIENDACCEPTFRIENDSHIP_PROPORTION_PROPERTY,UNFRIENDACCEPTFRIENDSHIP_PROPORTION_PROPERTY_DEFAULT));
		double unfriendrejectfriendshipproportion=Double.parseDouble(p.getProperty(UNFRIENDREJECTFRIENDSHIP_PROPORTION_PROPERTY,UNFRIENDREJECTFRIENDSHIP_PROPORTION_PROPERTY_DEFAULT));
		//actions
		double getprofileactionproportion = Double.parseDouble(p.getProperty(GETRANDOMPROFILEACTION_PROPORTION_PROPERTY,GETRANDOMPROFILEACTION_PROPORTION_PROPERTY_DEFAULT));
		double getfriendsactionproportion = Double.parseDouble(p.getProperty(GETRANDOMLISTOFFRIENDSACTION_PROPORTION_PROPERTY,GETRANDOMLISTOFFRIENDSACTION_PROPORTION_PROPERTY_DEFAULT));
		double getpendingrequestsactionproportion = Double.parseDouble(p.getProperty(GETRANDOMLISTOFPENDINGREQUESTSACTION_PROPORTION_PROPERTY,GETRANDOMLISTOFPENDINGREQUESTSACTION_PROPORTION_PROPERTY_DEFAULT));
		double inviteFriendactionproportion = Double.parseDouble(p.getProperty(INVITEFRIENDSACTION_PROPORTION_PROPERTY,INVITEFRIENDSACTION_PROPORTION_PROPERTY_DEFAULT));
		double acceptfriendactionproportion = Double.parseDouble(p.getProperty(ACCEPTFRIENDSACTION_PROPORTION_PROPERTY,ACCEPTFRIENDSACTION_PROPORTION_PROPERTY_DEFAULT));
		double rejectfriendactionproportion = Double.parseDouble(p.getProperty(REJECTFRIENDSACTION_PROPORTION_PROPERTY,REJECTFRIENDSACTION_PROPORTION_PROPERTY_DEFAULT));
		double unfriendfriendactionproportion = Double.parseDouble(p.getProperty(UNFRIENDFRIENDSACTION_PROPORTION_PROPERTY,UNFRIENDFRIENDSACTION_PROPORTION_PROPERTY_DEFAULT));
		double gettopresourcesactionproportion = Double.parseDouble(p.getProperty(GETTOPRESOURCEACTION_PROPORTION_PROPERTY,GETTOPRESOURCEACTION_PROPORTION_PROPERTY_DEFAULT));
		double postcommentonresourceactionproportion = Double.parseDouble(p.getProperty(POSTCOMMENTONRESOURCEACTION_PROPORTION_PROPERTY,POSTCOMMENTONRESOURCEACTION_PROPORTION_PROPERTY_DEFAULT));
		double delcommentonresourceactionproportion = Double.parseDouble(p.getProperty(DELCOMMENTONRESOURCEACTION_PROPORTION_PROPERTY,DELCOMMENTONRESOURCEACTION_PROPORTION_PROPERTY_DEFAULT));
		double viewCommentOnResourceactionproportion = Double.parseDouble(p.getProperty(GETCOMMENTSONRESOURCEACTION_PROPORTION_PROPERTY,GETCOMMENTSONRESOURCEACTION_PROPORTION_PROPERTY_DEFAULT));

		usercount=Integer.parseInt(p.getProperty(Client.USER_COUNT_PROPERTY, Client.USER_COUNT_PROPERTY_DEFAULT));
		useroffset = Integer.parseInt(p.getProperty(Client.USER_OFFSET_PROPERTY,Client.USER_COUNT_PROPERTY_DEFAULT));
		requestdistrib=p.getProperty(REQUEST_DISTRIBUTION_PROPERTY,REQUEST_DISTRIBUTION_PROPERTY_DEFAULT);
		machineid = Client.machineid;


		keysequence=new CounterGenerator(useroffset);
		operationchooser=new DiscreteGenerator();
		if (getownprofileproportion>0)
		{
			operationchooser.addValue(getownprofileproportion,"OWNPROFILE");
		}

		if (getfriendprofileproportion>0)
		{
			operationchooser.addValue(getfriendprofileproportion,"FRIENDPROFILE");
		}

		if (postcommentonresourceproportion>0)
		{
			operationchooser.addValue(postcommentonresourceproportion,"POSTCOMMENT");
		}
		
		if (delcommentonresourceproportion>0)
		{
			operationchooser.addValue(delcommentonresourceproportion,"DELCOMMENT");
		}

		if(acceptfriendshipproportion > 0)
		{
			operationchooser.addValue(acceptfriendshipproportion,"ACCEPTREQ");
		}

		if(rejectfriendshipproportion > 0)
		{
			operationchooser.addValue(rejectfriendshipproportion,"REJECTREQ");
		}

		if(unfriendacceptfriendshipproportion > 0)
		{
			operationchooser.addValue(unfriendacceptfriendshipproportion,"UNFRNDACCEPTREQ");
		}

		if(unfriendrejectfriendshipproportion > 0)
		{
			operationchooser.addValue(unfriendrejectfriendshipproportion,"UNFRNDREJECTREQ");
		}

		if(unfriendfriendproportion > 0)
		{
			operationchooser.addValue(unfriendfriendproportion,"UNFRNDREQ");
		}

		if(genfriendshipproportion > 0)
		{
			operationchooser.addValue(genfriendshipproportion,"GENFRNDREQ");
		}

		//actions
		if(getprofileactionproportion > 0)
		{
			operationchooser.addValue(getprofileactionproportion,"GETPROACT");
		}
		if(getfriendsactionproportion > 0)
		{
			operationchooser.addValue(getfriendsactionproportion,"GETFRNDLSTACT");
		}
		if(getpendingrequestsactionproportion > 0)
		{
			operationchooser.addValue(getpendingrequestsactionproportion,"GETPENDACT");
		}
		if(inviteFriendactionproportion > 0)
		{
			operationchooser.addValue(inviteFriendactionproportion,"INVFRNDACT");
		}
		if(acceptfriendactionproportion > 0)
		{
			operationchooser.addValue(acceptfriendactionproportion,"ACCFRNDACT");
		}
		if(rejectfriendactionproportion > 0)
		{
			operationchooser.addValue(rejectfriendactionproportion,"REJFRNDACT");
		}
		if(unfriendfriendactionproportion > 0)
		{
			operationchooser.addValue(unfriendfriendactionproportion,"UNFRNDACT");
		}
		if(gettopresourcesactionproportion > 0)
		{
			operationchooser.addValue(gettopresourcesactionproportion,"GETRESACT");
		}
		if(viewCommentOnResourceactionproportion > 0)
		{
			operationchooser.addValue(viewCommentOnResourceactionproportion,"GETCMTACT");
		}
		if(postcommentonresourceactionproportion > 0)
		{
			operationchooser.addValue(postcommentonresourceactionproportion,"POSTCMTACT");
		}
		if(delcommentonresourceactionproportion > 0)
		{
			operationchooser.addValue(delcommentonresourceactionproportion,"DELCMTACT");
		}

		transactioninsertkeysequence=new CounterGenerator(usercount);
		long loadst = System.currentTimeMillis();
		if (requestdistrib.compareTo("uniform")==0)
		{
			keychooser=new UniformIntegerGenerator(0,usercount-1);
			myMemberObjs = new Member[usercount];
			for(int j=0; j<usercount; j++){
				memberIdxs.put(j+useroffset, j);
				Member newMember = new Member(j+useroffset, j, (j%numShards), (j/numShards+j%numShards));
				myMemberObjs[j] = newMember;
			}
		}
		else if (requestdistrib.compareTo("zipfian")==0)
		{
			//it does this by generating a random "next key" in part by taking the modulus over the number of keys
			//if the number of keys changes, this would shift the modulus, and we don't want that to change which keys are popular
			//so we'll actually construct the scrambled zipfian generator with a keyspace that is larger than exists at the beginning
			//of the test. that is, we'll predict the number of inserts, and tell the scrambled zipfian generator the number of existing keys
			//plus the number of predicted keys as the total keyspace. then, if the generator picks a key that hasn't been inserted yet, will
			//just ignore it and pick another key. this way, the size of the keyspace doesn't change from the perspective of the scrambled zipfian generator
			keychooser=new ScrambledZipfianGenerator(usercount);
			myMemberObjs = new Member[usercount];
			for(int j=0; j<usercount; j++){
				memberIdxs.put(j+useroffset, j);
				Member newMember = new Member(j+useroffset, j, (j%numShards), (j/numShards+j%numShards));
				myMemberObjs[j] = newMember;
			}
		}
		else if(requestdistrib.compareTo("dzipfian")==0){
			System.out.println("Create fragments in workload init phase");
			Fragmentation createFrags = new Fragmentation(usercount, Integer.parseInt(p.getProperty(Client.NUM_BG_PROPERTY,Client.NUM_BG_PROPERTY_DEFAULT)),machineid,p.getProperty("probs",""), ZipfianMean);
			myDist = createFrags.getMyDist();
			int[] myMembers = createFrags.getMyMembers();
			usercount = myMembers.length;
			myMemberObjs =new Member[usercount];
			for(int j=0; j<usercount;j++){
				memberIdxs.put(myMembers[j], j);
				Member newMember = new Member(myMembers[j], j, (j%numShards), (j/numShards));
				myMemberObjs[j] = newMember;
			}

		}
		else if (requestdistrib.compareTo("latest")==0)
		{
			keychooser=new SkewedLatestGenerator(transactioninsertkeysequence);
			myMemberObjs = new Member[usercount];
			for(int j=0; j<usercount; j++){
				memberIdxs.put(j+useroffset, j);
				Member newMember = new Member(j+useroffset, j, (j%numShards), (j/numShards+j%numShards));
				myMemberObjs[j] = newMember;
			}
		}
		else
		{
			throw new WorkloadException("Unknown request distribution \""+requestdistrib+"\"");
		}
		System.out.println("Time to create fragments : "+(System.currentTimeMillis()-loadst)+" msec");

		userStatusShards = new char[numShards][];
		uStatSemaphores = new Semaphore[numShards];

		userFreqShards = new int[numShards][];
		uFreqSemaphores = new Semaphore[numShards];

		int avgShardSize = usercount/numShards;
		int remainingMembers = usercount-(avgShardSize*numShards);
		for(int i=0; i<numShards; i++){
			int numShardUsers = avgShardSize;
			if(i<remainingMembers)
				numShardUsers++;
			userStatusShards[i] = new char[numShardUsers];
			userFreqShards[i] = new int[numShardUsers];
			for(int j=0; j<numShardUsers; j++){
				userStatusShards[i][j]='d';
				userFreqShards[i][j]=0;
			}
			uStatSemaphores[i] = new Semaphore(1, true);
			uFreqSemaphores[i] = new Semaphore(1, true);
		}



		try {
			rStat.acquire();
			userRelations = new HashMap[usercount];
			for(int i=0; i<myMemberObjs.length; i++){
				//initially adding every user to the related vector of themselves
				HashMap<Integer, String> init = new HashMap<Integer, String>();
				init.put(myMemberObjs[i].get_uid(),"");
				userRelations[i] = init;
			}
			rStat.release();
		} catch (InterruptedException e) {
			e.printStackTrace(System.out);
		}


		//initialize the pendingFrnds, the acceptedFrnds and the createdresources data structures
		int numResPerUser = Integer.parseInt(p.getProperty(Client.RESOURCE_COUNT_PROPERTY, Client.RESOURCE_COUNT_PROPERTY_DEFAULT));
		pendingFrnds = new Vector[usercount];
		acceptedFrnds = new HashMap[usercount];
		createdResources = new Vector[usercount];
		postedComments = new HashMap<Integer, Vector<Integer>>();
		maxCommentIds = new HashMap<Integer, Integer>(0);
		for(int i=0; i<myMemberObjs.length;i++){
			pendingFrnds[i]= new Vector<Integer>();
			acceptedFrnds[i] = new HashMap<Integer,String>();
			createdResources[i] = new Vector<Integer>();
			for(int j=0; j<numResPerUser; j++){
				postedComments.put((myMemberObjs[i].get_uid()*numResPerUser+j), new Vector<Integer>());
				maxCommentIds.put((myMemberObjs[i].get_uid()*numResPerUser+j), 0);
			}
		}

		if(p.getProperty(Client.INIT_STATS_REQ_APPROACH_PROPERTY) != null && p.getProperty(Client.INIT_STATS_REQ_APPROACH_PROPERTY).equalsIgnoreCase("QUERYDATA")){
			int numQThreads = 5;
			Vector<initQueryThread> qThreads = new Vector<initQueryThread>();
			int tUserCount = myMemberObjs.length / numQThreads;
			int remainingUsers = myMemberObjs.length - (tUserCount*numQThreads);
			int addUser = 0;
			for(int u=0; u<numQThreads; u++){
				if(u == numQThreads-1)
					addUser = remainingUsers;
				int[] tMembers = new int[tUserCount+addUser];
				for(int d=0; d<tUserCount+addUser; d++)
					tMembers[d] = myMemberObjs[d+u*tUserCount].get_uid();
				initQueryThread t = new initQueryThread(tMembers, p);
				qThreads.add(t);
				t.start();	
			}
			for (Thread t : qThreads) {
				try {
					t.join();
					initStats.putAll(((initQueryThread)t).getInit());
					HashMap<Integer, Vector<Integer>> pends = ((initQueryThread)t).getPendings();
					Set<Integer> keys = pends.keySet();
					Iterator<Integer> it = keys.iterator();
					while(it.hasNext()){
						int aKey = (Integer)(it.next());
						pendingFrnds[memberIdxs.get(aKey)] = pends.get(aKey);
						for(int d=0; d<pends.get(aKey).size(); d++){
							relateUsers(aKey, pends.get(aKey).get(d));
						}
					}
					
					HashMap<Integer, Vector<Integer>> confs = ((initQueryThread)t).getConfirmed();
					keys = confs.keySet();
					it = keys.iterator();
					while(it.hasNext()){
						int aKey = (Integer)(it.next());
						for(int d=0; d<confs.get(aKey).size(); d++){
							acceptedFrnds[memberIdxs.get(aKey)].put(confs.get(aKey).get(d),null);
							relateUsers(aKey, confs.get(aKey).get(d));
						}
					}
					
					HashMap<Integer, Vector<Integer>> resources = ((initQueryThread)t).getResources();
					Set<Integer> ukeys = resources.keySet();
					it = ukeys.iterator();
					while(it.hasNext()){
						int uKey = (Integer)(it.next());
						createdResources[memberIdxs.get(uKey)] = resources.get(uKey);
					}
					((initQueryThread)t).freeResources();
				}catch(Exception e){
					e.printStackTrace(System.out);
				}
			}
			
			qThreads.clear();
			qThreads = null;

			
		}
		else if(p.getProperty(Client.INIT_STATS_REQ_APPROACH_PROPERTY) != null && 
				p.getProperty(Client.INIT_STATS_REQ_APPROACH_PROPERTY).equalsIgnoreCase("LOADFILE"))
		{
			int tUserCount = myMemberObjs.length;
			int numResourcesPerUser = 10;
			int numFriendsPerUser = 100;
			int userOffset = 0;
			double confPerc = 1;
			
			int friendId;
			
			if(p.getProperty(Client.RESOURCE_COUNT_PROPERTY) == null || 
					p.getProperty(Client.FRIENDSHIP_COUNT_PROPERTY) == null || 
					p.getProperty(Client.CONFPERC_COUNT_PROPERTY) == null || 
					p.getProperty(Client.USER_OFFSET_PROPERTY) == null)
			{
				throw new WorkloadException("parameters not specified for initapproach=loadfile. " +
						"Be sure to include the file used to load the data (e.g: -P workloads/populateDB)");
			}
			
			numResourcesPerUser = Integer.parseInt(p.getProperty(Client.RESOURCE_COUNT_PROPERTY));
			numFriendsPerUser = Integer.parseInt(p.getProperty(Client.FRIENDSHIP_COUNT_PROPERTY));
			confPerc = Double.parseDouble(p.getProperty(Client.CONFPERC_COUNT_PROPERTY));
			userOffset = Integer.parseInt(p.getProperty(Client.USER_OFFSET_PROPERTY));
			
			if(confPerc != 0 && confPerc != 1.0)
			{
				throw new WorkloadException("confperc must be 0 or 1 to use initapproach=loadfile");
			}
			else if(userOffset != 0)
			{
				throw new WorkloadException("non-zero useroffset not currently supported for initapproach=loadfile");
			}
			
			
			for( int i = 0; i < tUserCount; i++ )
			{
				initStats.put("PENDFRND-"+i, 0);
				initStats.put("ACCEPTFRND-"+i, numFriendsPerUser);
				for(int j = 0; j < numResourcesPerUser; j++)
				{
					initStats.put("POSTCOMMENT-"+(i*numResourcesPerUser +j), 0);
				}
				
				for(int j = 0; j < numFriendsPerUser + 1; j++)
				{
					friendId = i - (numFriendsPerUser / 2) + j;
					if(friendId < 0)
					{
						friendId += tUserCount;
					}
					else if(friendId >= tUserCount)
					{
						friendId -= tUserCount;
					}
					
					if(friendId != i)
					{
						acceptedFrnds[i].put(friendId, null);
						relateUsers(i, friendId);
					}
				}
			}
		}else if (p.getProperty(Client.INIT_STATS_REQ_APPROACH_PROPERTY) != null && 
				p.getProperty(Client.INIT_STATS_REQ_APPROACH_PROPERTY).equalsIgnoreCase("DETERMINISTIC")){
				
			int tUserCount = myMemberObjs.length;
			int numResourcesPerUser = 10;
			int numFriendsPerUser = 100;
			int userOffset = 0;
			int numLoadThread = 1;
			double confPerc = 1;
			if(p.getProperty(Client.RESOURCE_COUNT_PROPERTY) == null || 
					p.getProperty(Client.FRIENDSHIP_COUNT_PROPERTY) == null || 
					p.getProperty(Client.CONFPERC_COUNT_PROPERTY) == null ||
					p.getProperty(Client.NUM_LOAD_THREAD_PROPERTY) == null )
			{
				throw new WorkloadException("parameters not specified for initapproach=deterministic. " +
						"Be sure to include resourcecountperuser, friendcountperuser, confperc and numloadthreads )");
			}
			
			numResourcesPerUser = Integer.parseInt(p.getProperty(Client.RESOURCE_COUNT_PROPERTY));
			numFriendsPerUser = Integer.parseInt(p.getProperty(Client.FRIENDSHIP_COUNT_PROPERTY));
			confPerc = Double.parseDouble(p.getProperty(Client.CONFPERC_COUNT_PROPERTY));
			userOffset = Integer.parseInt(p.getProperty(Client.USER_OFFSET_PROPERTY));
			numLoadThread = Integer.parseInt(p.getProperty(Client.NUM_LOAD_THREAD_PROPERTY));
			
			if(confPerc != 0 && confPerc != 1.0)
			{
				throw new WorkloadException("confperc must be 0 or 1 to use initapproach=deterministic");
			}
			else if(userOffset != 0)
			{
				throw new WorkloadException("non-zero useroffset not currently supported for initapproach=loadfile");
			}
			
			if(Integer.parseInt(p.getProperty(Client.USER_COUNT_PROPERTY, Client.USER_COUNT_PROPERTY_DEFAULT)) <  numLoadThread){
				numLoadThread = 5;
			}
			if(Integer.parseInt(p.getProperty(Client.USER_COUNT_PROPERTY, Client.USER_COUNT_PROPERTY_DEFAULT)) % numLoadThread != 0){
				while(Integer.parseInt(p.getProperty(Client.USER_COUNT_PROPERTY, Client.USER_COUNT_PROPERTY_DEFAULT))% numLoadThread != 0)
					numLoadThread--; 
			}
			//ensure the friendship creation within clusters for each thread makes sense
			if(numFriendsPerUser != 0){
				int tmp = Integer.parseInt(p.getProperty(Client.USER_COUNT_PROPERTY, Client.USER_COUNT_PROPERTY_DEFAULT))/numLoadThread;
				while(tmp <= numFriendsPerUser){
					numLoadThread--;
					while(Integer.parseInt(p.getProperty(Client.USER_COUNT_PROPERTY, Client.USER_COUNT_PROPERTY_DEFAULT))%numLoadThread != 0)
						numLoadThread--;
					tmp = Integer.parseInt(p.getProperty(Client.USER_COUNT_PROPERTY, Client.USER_COUNT_PROPERTY_DEFAULT))/numLoadThread;					
				} 
			}
			//verify fragment size related to friendships
			if(tUserCount < numFriendsPerUser+1){
				System.out.println("Fragment size is too small, can't determine appropriate friendships. exiting.");
				System.exit(0);
			}
			//verify load thread count and fragment size
			if(numFriendsPerUser > tUserCount/numLoadThread){
				System.out.println("Could not have loaded with "+numLoadThread+" so considering 1 thread as number of load threads for deterministic");
				numLoadThread = 1;
			} 
			
			for( int i = 0; i < tUserCount; i++ )
			{
				if(confPerc == 1){
					initStats.put("PENDFRND-"+myMemberObjs[i].get_uid(), 0);
					initStats.put("ACCEPTFRND-"+myMemberObjs[i].get_uid(), numFriendsPerUser);
				}else{
					initStats.put("PENDFRND-"+myMemberObjs[i].get_uid(), numFriendsPerUser/2);
					initStats.put("ACCEPTFRND-"+myMemberObjs[i].get_uid(), 0);
				}
				//find the resources created for each user
				for(int j = 0; j < numResourcesPerUser; j++)
				{
					initStats.put("POSTCOMMENT-"+(myMemberObjs[i].get_uid()*numResourcesPerUser +j), 0);
					createdResources[i].add(myMemberObjs[i].get_uid()*numResourcesPerUser +j);
				}
				
			}
			
			//create the actual friendship or pending relationships
			int numUsersPerLoadThread = tUserCount/numLoadThread;
			int remaining = tUserCount - (numUsersPerLoadThread*numLoadThread);
			int addUserCnt = 0;
			for(int i = 0; i < numLoadThread; i++)
			{
				if(i == numLoadThread -1)
					addUserCnt = remaining;
				for(int u = i*numUsersPerLoadThread; u<numUsersPerLoadThread+i*numUsersPerLoadThread+addUserCnt; u++){
					int uidx = u;
					int ukey = myMemberObjs[uidx].get_uid();
					//TODO : the check for thread count and number of friends per user should be considered
					for(int j=0; j<numFriendsPerUser/2; j++){
						int fidx = i*numUsersPerLoadThread+((u-i*numUsersPerLoadThread)+j+1)%(numUsersPerLoadThread+addUserCnt);
						int fkey = myMemberObjs[fidx].get_uid();
						relateUsers(ukey, fkey);
						if(confPerc == 1){
							acceptedFrnds[uidx].put(fkey, null);
							acceptedFrnds[fidx].put(ukey, null);
						}else{
							pendingFrnds[fidx].add(ukey);
						}
					}
				}
			}
			
		}
		/*//Create file 
		FileWriter fstream = null;
		try {
			fstream = new FileWriter("outq"+machineid+".txt");
		} catch (IOException e1) {
			e1.printStackTrace();
		}
		  BufferedWriter out = new BufferedWriter(fstream);
		  
		Set keys = initStats.keySet();
		Iterator it = keys.iterator();
		while(it.hasNext()){
			String key = (String)(it.next());
			System.out.println(key+" "+initStats.get(key));
			try {
				out.write(key+" "+initStats.get(key)+"\n");
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	
		for(int i=0; i<pendingFrnds.length; i++){
			System.out.println(myMemberObjs[i].get_uid()+" "+pendingFrnds[i]);
			try {
				out.write(myMemberObjs[i].get_uid()+" "+pendingFrnds[i]+"\n");
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		
		for(int i=0; i<acceptedFrnds.length; i++){
			//System.out.println(myMemberObjs[i].get_uid()+" "+acceptedFrnds[i]);
			try {
				out.write(myMemberObjs[i].get_uid()+" "+acceptedFrnds[i]+"\n");
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		  for(int i=0; i<createdResources.length; i++){
				System.out.println(myMemberObjs[i].get_uid()+" "+createdResources[i]);
				try {
					out.write(myMemberObjs[i].get_uid()+" "+createdResources[i]+"\n");
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		try {
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		System.exit(0);*/
	}