Added initial ai implementation