added second version for testing transistor switching