recalculation of total values moved to methods addItem and removeItem