This requires a move from using `Set` to a regular `Array`, and saving the current state index on toggle instead of using `indexOf` the current value.