should be `toggleState(i: number, newVal?: boolean)` 
if newVal is a bool, then sets to that state; if newVal === undefined then toggle the state