Made ai improvements