search ($remainder, [grep {$part ne $_} @$parts], [@$used, $part]); } }