and removing matrixToPointer calls