protected function update_instance_ordering($instanceid, $ordering) {
        global $DB;
        $data = new stdClass();
        $data->id = $instanceid;
        $data->ordering = $ordering;
        $data->timemodified = time();

        $DB->update_record('tag_instance', $data);
    }