Add `weighted_total` functionality and caching