@ArmouredWizard In programming, "good" is relative to your priorities. This is a perfectly serviceable first iteration. For a future one, consider updating the total when you're adding or removing an item from inventory. This will reduce workload from "all items every time someone asks for the total" to "one item every time an item is added or removed".