Update ai.js

With lots of tries