mod matrix transpose