first part of turning word matrices into files of new legacy P data