Added better comments to the ai code