added AutoCharge class and its modifications