people studying egyptian history have divided the pharaohs into 31 groupings, called dynasties. these dynasties were usually, but not always, based on a related family group. during the long period of the pharaoh's rule over egypt, there were times when they did not control the whole country. this means that some dynasties only controlled part of the country, and another dynasty ruled another part at the same time. also there are not complete records, so there are gaps in the lists of pharaohs, and it can be very difficult to list the rulers in chronological order. the origins of the first pharaohs survive only as legends.