reordering based on condition - Filament