refactor the ai, provide for an adjustable lookahead.