Finished writing matrix dot function