Implement summary function
Added summary test