public String getSchedule()
  {
     ByteArrayOutputStream outputString = new ByteArrayOutputStream();
     PrintWriter output = new PrintWriter(outputString, true);
     if (timePoints.size() == 0) return "";
  
     BusStop[] tp = new BusStop[timePoints.size()];
     output.println("SCHEDULE FOR LINE " + name);
     for(int i=0, j=0; i < route.size(); i++)
     {
        BusStop bs = route.get(i);
        if (bs instanceof TimePoint)
        {
           tp[j++] = bs;
           output.printf("%20s",bs.getName());
        }   
     }   
     output.println();
     
     Time next = first;
     while (next.compareTo(last) != 1)
     {
        Time nextTimePoint = next.clone();
        for(int i=0; i < tp.length; i++)
        {
           nextTimePoint = nextTimePoint.advanceMinutes(timePoints.get(i));
           output.printf("%20s",nextTimePoint);
           
        }   
        output.println();
        next = next.advanceMinutes(period);
     }
     output.println();
     return outputString.toString(); 
    
  }