working on large matrices