2985 FOR K=1 TO NG+1