AI: returning a new AI data structure results in an undefined value, trying the .concat method