modifications to veterbi