lookahead: change const bool to const int, so as to use it safely as a loop counter.