diff --git a/pykat/components.py b/pykat/components.py
index bbb62d11f0eefb111ccec9941939d0d82e6c7faa..c697662bc4e979f3b811102fe2d91287743908d0 100644
--- a/pykat/components.py
+++ b/pykat/components.py
@@ -5,13 +5,12 @@ Created on Mon Jan 28 11:10:01 2013
 @author: Daniel
 """
 import exceptions
-import pykat.gui.resources
 import pykat
-import pykat.gui.graphics
-#from pykat.gui.graphics import *
 from pykat.node_network import *
-#from PyQt4.QtGui import *
-#from PyQt4.Qt import *
+
+import pykat.gui.resources
+import pykat.gui.graphics
+from pykat.gui.graphics import *
 
 class Component(object) :
     def __init__(self, name):
@@ -172,8 +171,8 @@ class mirror(Component):
     def getQGraphicsItem(self):
         if self._svgItem == None:
             nodes = self.getNodes()
-            self._svgItem = pykat.gui.graphics.ComponentQGraphicsItem(":/resources/mirror_flat.svg",self
-                                                ,[(-4,15,nodes[0]),(14,15,nodes[1])])
+            self._svgItem = pykat.gui.graphics.ComponentQGraphicsItem(":/resources/mirror_flat.svg", self ,[(-4,15,nodes[0]), (14,15,nodes[1])])
+            
         return self._svgItem
    
    
diff --git a/pykat/finesse.py b/pykat/finesse.py
index 662240128f57befbe450755e239b7e365a875209..ccb16d25832db82f6eb502aeff77fea2ce6e2676 100644
--- a/pykat/finesse.py
+++ b/pykat/finesse.py
@@ -37,7 +37,9 @@ from pykat.node_network import NodeNetwork
 from pykat.detectors import Detector
 from pykat.components import Component
 from pykat.commands import Command, xaxis
-from pykat.gui.gui import openGUI
+from pykat.gui.gui import pyKatGUI
+
+NO_GUI = False
 
 class MissingFinesseEnvVar(Exception) :    
     def __str__(self) :
@@ -93,7 +95,7 @@ class kat(object):
         self.__gui = None
         self.nodes = NodeNetwork(self)  
         self.__katexe = katexe
-        
+        self.pykatgui = None
         # Various         
         self.__phase = None
         self.__maxtem = None
@@ -405,7 +407,15 @@ class kat(object):
         return out
         
     def openGUI(self):
-        self.__gui = openGUI(self)
+        if NO_GUI:
+            print  "No PyQt4 module was installed so cannot open a GUI"
+        else:
+            if self.pykatgui == None:
+                #self.app = QtGui.QApplication([""])
+                self.pykatgui = pyKatGUI(self)
+                self.pykatgui.main()
+            else:
+                self.pykatgui.show()
     
     def getComponents(self):
         return self.__components.values()
diff --git a/pykat/gui/gui.py b/pykat/gui/gui.py
index d59aba602b4ba8c45186a3a5d217c9b416004e8c..db41984bd3919fbed5a3aa27d481ba41b50c8037 100644
--- a/pykat/gui/gui.py
+++ b/pykat/gui/gui.py
@@ -15,13 +15,6 @@ from pykat.gui.graphics import *
 import qt_gui
 import functools
 
-def openGUI(kat):
-    app = QtGui.QApplication([""])
-    pykatgui = pyKatGUI(kat)
-    pykatgui.main()
-    app.exec_()
-   
-
 class pyKatGUI(QtGui.QMainWindow, qt_gui.Ui_MainWindow):
     def __init__(self, kat,parent=None):
         super(pyKatGUI, self).__init__(parent)