codes for indexBuilding