Modified code of graphical interface, YET TO BE TESTED, BE CAREFUL