Use 0-based indexes internally