calculation for charges formula completed.