Implements times function