implemented a first version AI