Trying to improve the sorting
diff --git a/scripts/cells.pl b/scripts/cells.pl
index 300b5e2..1f53983 100644
--- a/scripts/cells.pl
+++ b/scripts/cells.pl
@@ -20,7 +20,7 @@
 our $nextla=0;
 our $nextio=0;
 
-foreach my $mag(<$STDCELLLIB/Catalog/*.mag>)
+foreach my $mag(sort <$STDCELLLIB/Catalog/*.mag>)
 {
   next if((-s $mag)<=50);
   #print `ls -la $mag`;
@@ -38,7 +38,7 @@
   {
     if(m/^\.inputs (.*)/)
     {
-      foreach my $inp(split " ",$1)
+      foreach my $inp(sort split " ",$1)
       {
         my $io=$nextio++;
 	print "  inout $inp, // input\n";
@@ -46,7 +46,7 @@
     }
     if(m/^\.outputs (.*)/)
     {
-      foreach my $outp(split " ",$1)
+      foreach my $outp(sort split " ",$1)
       {
         my $io=$nextio++;
 	print "  inout $outp, // output\n";
diff --git a/scripts/generator.pl b/scripts/generator.pl
index 58b4525..690a261 100644
--- a/scripts/generator.pl
+++ b/scripts/generator.pl
@@ -82,7 +82,7 @@
   {
     if(m/^\.inputs (.*)/)
     {
-      foreach my $inp(split " ",$1)
+      foreach my $inp(sort split " ",$1)
       {
         my $io=$nextio++;
 	if($io<$MPRJ_IO_PADS)
@@ -101,7 +101,7 @@
     }
     if(m/^\.outputs (.*)/)
     {
-      foreach my $outp(split " ",$1)
+      foreach my $outp(sort split " ",$1)
       {
         my $io=$nextio++;
 	if($io<$MPRJ_IO_PADS)
diff --git a/scripts/placement.pl b/scripts/placement.pl
index ed45411..1e1bed0 100644
--- a/scripts/placement.pl
+++ b/scripts/placement.pl
@@ -7,7 +7,7 @@
 
 my $STDCELLLIB=$ENV{'STDCELLLIB'} || "/home/philipp/libresilicon/StdCellLib";
 
-foreach my $mag(<$STDCELLLIB/Catalog/*.mag>)
+foreach my $mag(sort <$STDCELLLIB/Catalog/*.mag>)
 {
   next if((-s $mag)<=50);
   #print `ls -la $mag`;
diff --git a/scripts/testgen.pl b/scripts/testgen.pl
index bd11706..2af77d5 100644
--- a/scripts/testgen.pl
+++ b/scripts/testgen.pl
@@ -9,8 +9,8 @@
 
 my $header=<IN>;
 my @l=split "->",$header;
-my @ins=split " ",$l[0];
-my @outs=split " ",$l[1];
+my @ins=sort split " ",$l[0];
+my @outs=sort split " ",$l[1];
 my %map=();
 
 my $reg=0;