anchor.diff:         conn.close();
       }
   
  +    out.println(description);
  +    while (rset != null && rset.next()) { 
  +	String first = "";
  +	String last = "";
  +	String testType = ""; 
  +	String time = "";
  +	
  +	if (patient != null) {
  +		first = rset.getString("first_name");
  +		last = rset.getString("last_name");
   
  -    if (rset != null && rset.next()) {
  -        out.println(description);
  -        out.println(rset.getString("COUNT(image_id)"));
  -    } else {
  -        out.println("Error: Could not generate analysis");
  -    }
  +		if ((first == null) || (last == null)) {
  +			continue;
  +		}
  +	}
  +	if (test_type != null) {
  +		testType = rset.getString("test_type");
  +		if (testType == null) {
  +			continue;
  +		}
  +	}
  +	if (!time_period.equals("None")) {
  +		time = rset.getString("time");
  +		
  +		if (time == null) {
  +			continue;
  +		}
  +		
  +	}
  +	String count = rset.getString("COUNT(image_id)");
  +
  +	out.println("<br>");
  +	out.println("<table style='width:50%'>");
  +	out.println("<tr><td>Patient: </td><td>"+first+""+last+"</td>");
  +	out.println("<td>Test type: </td><td>"+testType+"</td>");
  +	out.println("<td>Time period: </td><td>"+time+"</td></tr>");
  +	out.println("<td>Count: </td><td>"+count+"</td>");
  +        out.println("</table>");
  +    } 
   
       conn.close();
  -	out.println("<a href='./UserManageMenu.html'>Return to menu</a>");
  +	out.println("<br><a href='./Home_Menu.jsp'>Return to menu</a>");
   }
   
   else{ %>
  
positive.code:     connmaker cn = null;
      sqlcontroller scontroller= null;
  
      String patient = (request.getParameter("PATIENT").trim());
      String test_type = (request.getParameter("TESTTYPE").trim());
      String time_period = (request.getParameter("TIMEPERIOD").trim());
  
      //Create sql statement based on user's choice
      String sqlString = "SELECT ";
      String dataCube = "GROUP BY CUBE (";
      String description = "Displaying number of images for each ";
  
      if (patient.equals("True")) {
          String nameParam = "first_name, last_name, ";
          sqlString += nameParam;
          dataCube += nameParam;
          description += "patient, ";
      }
      if (test_type.equals("True")) {
          String testTypeParam = "test_type, ";
          sqlString += testTypeParam;
          dataCube += testTypeParam;
          description += "test type, ";
      }
      if (time_period.equals("Yearly")) {
          String yearParam = "TRUNC(test_date, 'YEAR'), ";
          sqlString += yearParam;
          dataCube += yearParam;
          description += "year, ";
      }
      if (time_period.equals("Monthly")) {
               String monthParam = "TRUNC(test_date, 'MONTH'), ";
               sqlString += monthParam;
               dataCube += monthParam;
               description += "month, ";
       }
      if (time_period.equals("Weekly")) {
               String weekParam = "TRUNC(test_date, 'WW'), ";
               sqlString += weekParam;
               dataCube += weekParam;
               description += "week, ";
       }
  
      sqlString = sqlString.replaceAll(",$", "");
      dataCube = dataCube.replaceAll(",$", "");
      description = description.replaceAll(",$", ":");
      sqlString += " COUNT(image_id) FROM analysis_view ";
      sqlString += dataCube;
  
negative.code:     ResultSet rset = null;
  
      try{
  	out.println(sqlString);
          stmt = conn.createStatement();
          rset = stmt.executeQuery(sqlString);
  
  