done with Perm but new definition of transpose