Way too slow. Trying with arrays instead (bools are converted each time)
Better, but still too slow. Trying with 0/1 numbers instead... (WIP)