adapted for charging from various sources