Started to add recursive distinct sampling