creates freq matrix as list of list