the 244 from me.
won't post the long info as it's already there somewhere.
code:
function CDSorter($, $m)
dim $k,$a,$c,$i,$o,$l
$i=split(","+$,",")
for $k=0 to ubound($i)
for each $ in split($c)
$a=$+","+$k
$=0.
for each $l in split($a,",") $=$+$i[$l] next
if $<=$m & $o-$<$i[$k] if $>$o $o=$ $CDSorter=substr($a,2) endif $c=$c+$a+" " endif
next
next
endfunction

_________________________
!

download KiXnet