Implementation of the basic mult function