public Pair getNextPair() {		
		try{
			if (!currentMovieActorPairs.isEmpty()){
				Pair nextPair = currentMovieActorPairs.getFirst();
				currentMovieActorPairs.removeFirst();

				return nextPair;
			}else{
				while (true){
					if (moviesRS.next()){	
						int currentMovieYear = moviesRS.getInt(2);
						if (currentMovieYear >= beginYear && currentMovieYear <= endYear){
							boolean tester=true;
							if(this.genre!="")
								tester=false;
							if(tester || moviesRS.getString(3)==this.genre)
							{
							currentMovieID = moviesRS.getInt(1);
							setStream(beginYear, endYear); //creates actorRS
							prepareActorPairs();
							return getNextPair(); //try again now that we loaded a movies actors
							}
						}
					}else{ //No movies left! Return null to indicate no more pairs
						return null;
					}
				}
			}
		} catch (Exception e){
			e.printStackTrace();
		}
		return null;
	}