added initial ai code