Eliminated local alias to array of charges in some functions. Inlined the "charge" function to mitigate any performance impact. Fixes a number of shadowed variable warnings.