For case n>=8, the indices should be "7" rather than "8". 