AI: make intermediate AI data structure an Object so as to be able to pass by reference