adding index of coincidence code