[wip] int -> var. Keep track of event indexes.