How an NPN Transistor Works as a Switch?