added counts2matrix