insert charge function