
                        if(snap.val().P5.Tuesday!=null){
                                lt.push(snap.val().P5.Tuesday);
                            f = course_compare(tt,lt);
                            if(f==0){
                                labs.push("P5 - Tuesday: "+snap.val().P5.Tuesday);
                            }
                        }
                        if(snap.val().P5.Wednesday!=null){
                                lw.push(snap.val().P5.Wednesday);
                            f = course_compare(wt,lw);
                            if(f==0){
                                labs.push("P5 - Wednesday: "+snap.val().P5.Wednesday);
                            }
                        }
                        if(snap.val().P5.Thursday!=null){
                                lth.push(snap.val().P5.Thursday);
                            f = course_compare(tht,lth);
                            if(f==0){
                                labs.push("P5 - Thursday: "+snap.val().P5.Thursday);
                            }
                        }
                        if(snap.val().P5.Friday!=null){
                                lf.push(snap.val().P5.Friday);
                            f = course_compare(ft,lf);
                            if(f==0){
                                labs.push("P5 - Friday: "+snap.val().P5.Friday);
                            }
                        }
    
                        }
                        
                    })
                    if(labs.length>1)
                    {  check2++;
                    console.log(labs);
                    
                    }
    
                }  
                else
                check2++;  
                    if(snapshot.val().Tuts!=null){ //TUTS
                        tuts=[];
                        //console.log("tut check");
                        tuts.push(snapshot.key+ " = ");
                        snapshot.forEach(function(snap){ //for each day under child tuts
                        if(snap.val().T1!=null){
                            lm=[],lt=[],lw=[],lth=[],lf=[]; //tut days
                            if(snap.val().T1.Monday!=null){
                                lm.push(snap.val().T1.Monday);
                            f = course_compare(mt,lm);
                            if(f==0){
                                tuts.push("T1 - Monday: "+snap.val().T1.Monday);
                            }
                        }
                        if(snap.val().T1.Tuesday!=null){
                                lt.push(snap.val().T1.Tuesday);
                            f = course_compare(tt,lt);
                            if(f==0){
                                tuts.push("T1 - Tuesday: "+snap.val().T1.Tuesday);
                            }
                        }
                        if(snap.val().T1.Wednesday!=null){
                                lw.push(snap.val().T1.Wednesday);
                            f = course_compare(wt,lw);
                            if(flag==0){
                                tuts.push("T1 - Wednesday: "+snap.val().T1.Wednesday);
                            }
                        }
                        if(snap.val().T1.Thursday!=null){
                                lth.push(snap.val().T1.Thursday);
                            f = course_compare(tht,lth);
                            if(f==0){
                                tuts.push("T1 - Thursday: "+snap.val().T1.Thursday);
                            }
                        }
                        if(snap.val().T1.Friday!=null){
                                lf.push(snap.val().T1.Friday);
                            f = course_compare(ft,lf);
                            if(f==0){
                                tuts.push("T1 - Friday: "+snap.val().T1.Friday);
                            }
                        }
    
    
                        }
    
                        if(snap.val().T2!=null){
                            lm=[],lt=[],lw=[],lth=[],lf=[]; //lab days
                            if(snap.val().T2.Monday!=null){
                                lm.push(snap.val().T2.Monday);
                            f= course_compare(mt,lm);
                            if(f==0){
                                tuts.push("T2 - Monday: "+snap.val().T2.Monday);
                            }
                        }
                        if(snap.val().T2.Tuesday!=null){
                                lt.push(snap.val().T2.Tuesday);
                            f = course_compare(tt,lt);
                            if(f==0){
                                tuts.push("T2 - Tuesday: "+snap.val().T2.Tuesday);
                            }
                        }
                        if(snap.val().T2.Wednesday!=null){
                                lw.push(snap.val().T2.Wednesday);
                            f = course_compare(wt,lw);
                            if(f==0){
                                tuts.push("T2 - Wednesday: "+snap.val().T2.Wednesday);
                            }
                        }
                        if(snap.val().T2.Thursday!=null){
                                lth.push(snap.val().T2.Thursday);
                            f = course_compare(tht,lth);
                            if(f==0){
                                tuts.push("T2 - Thursday: "+snap.val().T2.Thursday);
                            }
                        }
                        if(snap.val().T2.Friday!=null){
                                lf.push(snap.val().T2.Friday);
                            f = course_compare(ft,lf);
                            if(f==0){
                                tuts.push("T2 - Friday: "+snap.val().T2.Friday);
                            }
                        }
    
                        }
    
                        if(snap.val().T3!=null){
                            lm=[],lt=[],lw=[],lth=[],lf=[]; //lab days
                            if(snap.val().T3.Monday!=null){
                                lm.push(snap.val().T3.Monday);
                            f = course_compare(mt,lm);
                            if(f==0){
                                tuts.push("T3 - Monday: "+snap.val().T3.Monday);
                            }
                        }
                        if(snap.val().T3.Tuesday!=null){
                                lt.push(snap.val().T3.Tuesday);
                            f = course_compare(tt,lt);
                            if(f==0){
                                tuts.push("T3 - Tuesday: "+snap.val().T3.Tuesday);
                            }
                        }
                        if(snap.val().T3.Wednesday!=null){
                                lw.push(snap.val().T3.Wednesday);
                            f = course_compare(wt,lw);
                            if(f==0){
                                tuts.push("T3 - Wednesday: "+snap.val().T3.Wednesday);
                            }
                        }
                        if(snap.val().T3.Thursday!=null){
                                lth.push(snap.val().T3.Thursday);
                            f = course_compare(tht,lth);
                            if(f==0){
                                tuts.push("T3 - Thursday: "+snap.val().T3.Thursday);
                            }
                        }
                        if(snap.val().T3.Friday!=null){
                                lf.push(snap.val().T3.Friday);
                            f = course_compare(ft,lf);
                            if(f==0){
                                tuts.push("T3 - Friday: "+snap.val().T3.Friday);
                            }
                        }
    
                        }
                        if(snap.val().T4!=null){
                            lm=[],lt=[],lw=[],lth=[],lf=[]; //lab days
                            if(snap.val().T4.Monday!=null){
                                lm.push(snap.val().T4.Monday);
                            f = course_compare(mt,lm);
                            if(f==0){
                                tuts.push("T4 - Monday: "+snap.val().T4.Monday);
                            }
                        }
                        if(snap.val().T4.Tuesday!=null){
                                lt.push(snap.val().T4.Tuesday);
                            f = course_compare(tt,lt);
                            if(f==0){
                                tuts.push("T4 - Tuesday: "+snap.val().T4