fixed bug in matrix per matrix multiplcation