changed index merging to bitsets to avoid excessive use of io operations