fixed up query errors and AI player issues
fixed friend generator