coded basic logic for summary report