Add summarize function to driver.java