Main Applet
Added code and comments to main applet