fixed matrix multiply for N > 1