new algo for TA from general definition: two unfoldings of the matrix