private void incrementElements(int index, int variant) {
    if (variant == 0) {
      switch (index) {
        case 0:
          rightIndex++;
          break;
        case 1:
          topIndex++;
          break;
        case 2:
          topIndex++;
          rightIndex++;
          break;
        case 3:
          topIndex++;
          leftIndex--;
          break;
        default:
          break;
      }
    } else {
      switch (index) {
        case 0:
          leftIndex--;
          break;
        case 1:
          bottomIndex--;
          break;
        case 2:
          bottomIndex--;
          leftIndex--;
          break;
        case 3:
          rightIndex++;
          bottomIndex--;
          break;
        default:
          break;
      }
    }
  }