updated summary function