refactor card total percentage calculations.
Merge main repo