finally figured out the problem with lookaheads