Matrix print function