How does an transistor work.