made setup better and better ip logic in singleswitch.pl