merged AI class to main file