fixed missing accumulatedTotal var
merged; just commented out code