@result = sort { $a <=> $b } map { my $x = $_; grep $x == $_, @betas } @alphas;