corrected word occurance frequency calculation logic