Added summary function, rewrote code to eliminate necessity of selecting a date limited query