implement summary function