public static Schedule popSelectedCourses(ResultSet r){
		Schedule sched = new Schedule();
		try{
			while (r.next()){
				ArrayList<Character> days1 = getDaysList(r.getString("days1"));
				ArrayList<Character> days2 = getDaysList(r.getString("days2"));
				ArrayList<String> focus = getFocusList(r.getString("focus"));
				
				// skip classes that have days and times that are to be
				// determined as we cannot use them to create a schedule
				if ((r.getString("days1")).equals("TBA") || 
						(r.getString("days2")).equals("TBA") || 
						(r.getString("time1")).equals("TBA") || 
						(r.getString("time2")).equals("TBA"))
					continue;
				
				int[] times = getStartEndTime(r.getString("time1"));
				int timeStart1 = times[START];
				int timeEnd1 = times[END];
	
				int timeStart2, timeEnd2;
				if (r.getString("time2").equals("NULL")){
					timeStart2 = 9999;
					timeEnd2 = 9999;
				}
				else {
					times = getStartEndTime(r.getString("time2"));
					timeStart2 = times[START];
					timeEnd2 = times[END];
				}
				
				String room2 = r.getString("room2");
				if (room2.equals("NULL"))
					room2 = "";
				
				Course c = new Course(r.getString("title"),
						r.getInt("crn"), 
						r.getInt("credits"),
						r.getString("professor"),
						days1,
						days2,
						timeStart1,
						timeStart2,
						timeEnd1,
						timeEnd2,
						r.getString("room1"),
						room2);
				c.setFocusReqs(focus);
						
				sched.addCourse(c);
			}
		}catch (Exception e){
			e.printStackTrace();
		}
		return sched;
	}