5240 FOR JJ=1 TO K