Added writeSummary method