added the multiplication function for matrices