code for A.I.