Refactor to use total.
Refactor script.
Refactor for efficiency.