passing tests and made mat_times_mat more conservative