PERF: Use matrix manipulation instead of iterator