Further changes to simulator. Applet now works.