added ai function, still on process