Improve matrix formatting.