replaced applet code in SampleChi