made the new AI more general for later implementation.