added comments changed constructor in ai class