Only recalculting per item type each time instead of recalculating for all items. Had not previously noticed that it's a pain to sum an array in Ruby - inject is so ugly