fixed bug in gen_three_port

s33 was assigned incorrectly
now handles both "12" and "21" names properly

also added functionality for 1,2 or 3 inputs