use 0-based indices for cups