Adding more matrices and generalizing passing new matrices