improves the summary function