modifed java code for GUI launch