Right before the GOTO @LOOP put ENDIF and probably put a VSYNC 1 in there somewhere.