Write mult function