Some more matrix chain product replacements
Helper functions for product multiplication