Clean-up and starting to fix ai