Add Lookahead and fix bugs