At the Polytechnic school Tesla began his studies in mechanical and electrical engineering. One day a physics teacher showed Tesla's class a new Gramme dynamo that—by employing direct current—could be used as both a motor and a generator. After watching it for a time, Tesla suggested it might be possible to do away with a set of inefficient sparking connections known as commutators. This, his amused professor said, would be like building a perpetual motion machine! Not even Tesla could hope to achieve such a feat. For the next several years the challenge obsessed Tesla, who instinctively knew that the solution lay in electric currents that alternated.