process array and matrix