AI changes

#1 made a more complex AI #2 simplified codes