improve ai to go for win and refactor code
add complete ai