add convertMatricesToTPN but not finished