code for summary data