fixed tree bug in intelligent ai class, now starts from 0