added array for pins, more dynamic than switch case