use index instead of bools