minor
created a function OutputMatrix to abbreviate the final commands