The structure of belief systems