improved AI
added missing files
improved some code