Finish Applet assignment. Might need further improvement.