Improve matrix traverse methods