Added a GUI class for visual testing.
Updated code for Java 1.7