welp...don't want to go looking for this again:
int idx= int(payload.flip);
“The sciences do not try to explain, they hardly even try to interpret, they mainly make models. By a model is meant a mathematical construct which with the addition of certain verbal interpretations describes observed phenomena. The justification of such a model construct is solely and precisely that it is expected to work.” John Von Neumann
welp...don't want to go looking for this again:
int idx= int(payload.flip);