applet code moved from stn 1_40 and 1_50