public static void main(String[] args){
		mongoDB();
		System.out.println("connected");
		ArrayList<BasicDBObject> myList = new ArrayList<BasicDBObject>();
////////////////////////////////////////////////////
		BasicDBObject query1 = new BasicDBObject("hashtags.text", "gameofthrones");		
		BasicDBObject query2 = new BasicDBObject("hashtags.text", "gotquotes");
		BasicDBObject query3 = new BasicDBObject("hashtags.text", "GoTFans");
		myList.add(query1);
		myList.add(query2);
		myList.add(query3);
		long[][] timeData = new long[][] {{-18000, 1367197200000L},	//eastern
				  {-21600,1367197200000L}};	//central
		long duration = 3600000;//length of program

//////////////////////////////////////////////////////
		DBCursor cursor = null;
		long stepDuration = 3000;	//3sec
		long buffer = 1800000; //30min;
		int inc = 1;
		int utc = 0, start = 1;
		long endTime;
		long showStartTime;
		long week = 604800000; //week
		long day = 86400000; //day 
		long hour = 3600000;
		int h = 0;
		Date date;
		String sDate;
		DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
		try{
			FileWriter statsWriter = new FileWriter("showStats.txt", false);
			BufferedWriter statsBuffer = new BufferedWriter(statsWriter);
			statsBuffer.write("Record_Number,Date,Time_Zone,Relative_Time,Volume,Messages_Scent\n");
			long stepTime1 = 0;
			long stepTime2 = 0;
			long relativeTime;
			for (int w = 0; w < 1; w++) {								// week loop, 1 weeks total									// day loop 
				for (int i = 0; i < timeData.length; i++){				//time zone loop
					showStartTime =  timeData[i][start] - (h * hour)  + (w * week);
					stepTime1 = showStartTime - buffer;
					endTime = (showStartTime + duration) + buffer;
					date = new Date((long)stepTime1);
					sDate = df.format(date);
					while (stepTime1 < endTime){
						stepTime2 = stepTime1 + stepDuration;
						String stats = "";
						BasicDBObject query = new BasicDBObject("time",
										new BasicDBObject("$gte", stepTime1)
											      .append("$lte", stepTime2))
								.append("utcOffset",timeData[i][utc])
								.append("$or", myList);
						cursor = coll.find(query);
						int size = cursor.size();
						int sumFollowers = 0;
						while(cursor.hasNext()){
							sumFollowers += Integer.parseInt(cursor.next().get("followers").toString());
						}
						if (stepTime2 >= showStartTime)
							relativeTime = (stepTime2 - showStartTime)/60000;
						else
							relativeTime = -(showStartTime - stepTime2)/60000;
						stats +=  inc + ","
								+ sDate + ","
								+ timeZoneString(timeData[i][utc]) + "," 
								+ relativeTime + "," 
								+ size*20 + ","
								+ sumFollowers;
						statsBuffer.write(stats + "\n");
						stepTime1 = stepTime2;
						inc++;
					}
				}
				if (w == 2)
					h = 1;
			}
		cursor.close();
		statsBuffer.close();
		}
		
		catch(FileNotFoundException fnf)
		{
			System.out.print("Error: file not found");
		}
		catch(IOException io)
		{
			System.out.print("Error: IO exception");
		}
	}