fixed measure to not depend on order of idf