Working code
Working AI