What is the purpose of the commutator in an electric motor?