How an input and output pin can be both an input and output?