In the late Vedic period around the 6th century BCE, the small chiefdoms and states of Northern India had consolidated into 16 major kingdoms. Emerging urbanization gave rise to non-Vedic religions like Buddhism and Jainism, whose teachings attracted followers from all classes except the middle class. Chronicling the life of the Buddha was central to the beginnings of recorded history in India. During this period, pastoral peoples and new ruling classes were incorporated into the caste system as agriculture and the economy expanded.