Rewritten for the Swing GUI