public  String dateFormatter(int min,int track,int session) throws ParseException 
	{	

		cal = Calendar.getInstance();
		if(prevtrack!=track)
		{
			// Check if end not initialized or if it is the first call	
			if(end!=null)
			{
				// To check if it equal to lunchTime or session for the event is 2
				if(!((end.compareTo(lunchTime)==0)|| session==2))
				{
					// Check if startTime is not equal to end
					if(start.compareTo(end)!=0)
					{
						start = end; // update the start with endTime 
					}
				}
				//If session == 2 or endTime == lunchTime then update the startTime and endTime
				else
				{
					/* This will be true for first call, for next call it will be false, This will schedule the 
					 * events in second half
					 * */ 

					if(flag)
					{	
						System.out.println("12:00 PM Lunch"); 
						end = sdf.parse("1:00 PM");
						flag=false;
					}
					
					// To update the start time in second half
					if(start.compareTo(end)!=0)
					{
						start = end; 
					}
					/*if(start.compareTo(networkEventTime)>0)
					{
						// Set the Networking time as 5 PM event
					}
					else
					{
						//Set the networking event time from 4PM
					}*/
				}

			}
			//To update the calendar with correct startTime
			cal.setTime(start);

			// To add the event minutes in the calendar 
			cal.add(Calendar.MINUTE, min);

			// To get the endTime of the scheduled event 
			end = cal.getTime();

		}
		else
		{
			// To set the start time to 9:00 AM
			start = sdf.parse("09:00 AM");
		}
		//System.out.println(sdf.format(start) + " to " + sdf.format(end));

		// To update the calendar event with the endTime
		cal.setTime(end);
		//System.out.println("End Time : " + end);

		// Return the start time of the scheduled event
		return sdf.format(start);


	}