private int findCategoryIndex(Category c) {
      for (int i = 0; i < myCategories.size(); i++) {
        if (myCategories.get(i) == c) return i;
      }
      return -1;
    }
private int findCategoryIndex(Category c)