Fixed the input logic so any input can be accessed from any other input