work in progress: ai implementation