Adding charge function.