How did trade influence the development of the kingdoms and trading states of africa?