some ai improvements