output count matrix