added rebroadcasting to matrix operations