complete convertMatricesToTPN