added JFrame and main. stable run