Added code to make classes track the scope index of all inherited classes, which will later be unified to a single scope