Double Buffer Pattern

Double buffered AI implemented.