working on matrices, integrating