public void step() {
    int len = length();

    // remove steps that cancel out
    for (int i = 0; i < len; ++i) {
      switch (at(i)) {
      // We don't need this case, because the lower particle performs the same
      // check
      // case -1:
      // if (directInteraction && at(i - 1) == 1) {
      // set(i - 1, 0);
      // set(i, 0);
      // } else if (at(i - 2) == 1) {
      // set(i - 2, 0);
      // set(i, 0);
      // }
      //
      // break;
      case 1:
        if (directInteraction && at(i + 1) == -1) {
          set(i + 1, 0);
          set(i, 0);
        } else if (at(i + 2) == -1) {
          set(i + 2, 0);
          set(i, 0);
        }

        break;
      case 0:
        // do nothing
        break;
      }
    }

    // perform the resulting steps
    // use a new array for that
    int[] oldstate = lattice;
    lattice = new int[length()];
    for (int i = 0; i < len; ++i) {
      if (oldstate[i] != 0) {
        set(i + oldstate[i], 1);
      }
    }

    randomize();

    ++time;
  }