made applet much more functional