code: public int add(int index, int delta) {
          int val = map.get(index);
          int newVal = val + delta;
          if (newVal == 0)
              map.remove(index);
          else
              map.put(index, newVal);
          magnitude = -1;
          return newVal;
      }
docs: {@inheritDoc}