how does the alternator charge the battery