Added applet class. Changed a few things to make it work as an applet