add squares iterator; small improvement to AI