3530 FOR M=1 TO NG