changed to log2 for idf