completed index generator for purity calculations