ai is more precise, removed some bugs