clean up some whitespace
simplify applet
separate out test to expose code better