I would like to see how it’s wired up and if your using something that requires a pull up or a pull down resistor.
You have inputs but they may not be wired correctly or you need to use input pull-up in addition to code corrections.
Also get rid of Serial available. What do you need it for?
The reason your having an issue is because you have to monitor the state change of your inputs.
You may keep your first set of ints as they were originally but you must use a state variable and tell that to be the read of your PIN number whether the pin is 1 or 2 or whatever.
Then when you write the of statement use the state variable as your high and low. NOT THE PIN INT.