what is an alternator and what does it do? basic design and function