@Override
	public void run() {

		while (!paused) {
			update();
			repaint();
			
			if (inHandler.getKeys()[KeyEvent.VK_F3]) {
				if(!opened){
					opened=true;
					// opens new frame
					JFrame frame = new JFrame();
					frame.setSize(500, 210);
					frame.setLayout(new BorderLayout());
					
					 baos = new ByteArrayOutputStream();
					 PrintStream ps = new PrintStream(baos);
					 old = System.out;
					 System.setOut(ps);
					 textArea1 = new JTextArea();
					 textArea1.setEditable(false);
					 JScrollPane scrollPane = new JScrollPane(textArea1);
					 scrollPane.setPreferredSize(new Dimension(490,170));
					 frame.add(scrollPane, BorderLayout.NORTH);
					 textArea2 = new JTextArea();
					 textArea2.setPreferredSize(new Dimension(440,30));
					 frame.add(textArea2, BorderLayout.CENTER);
					 JButton but = new JButton("Enter");
					 but.setPreferredSize(new Dimension(50,30));
					 frame.add(but,BorderLayout.EAST);
					 frame.setVisible(true);
					 WinListener win = new WinListener();
					 but.addActionListener(win);
					 frame.addWindowListener(win);
					  Action keyAction = new AbstractAction() {
					        /**
							 * 
							 */
							private static final long serialVersionUID = 1L;

							@Override
					        public void actionPerformed(ActionEvent ae) {
					            System.out.println(textArea2.getText());
					           if(textArea2.getText().indexOf("/")==0){
					            String str= textArea2.getText().replace("/", "");
					            String[] str2 = str.split(" ");
					            Level.executeCommand(str2);
					            }
					            textArea2.setText("");
					            
					        }
					    };

					 textArea2.getInputMap().put(KeyStroke.getKeyStroke("ENTER"), "ENTER key");
				       textArea2.getActionMap().put("ENTER key", keyAction);
					 System.out.println("Started Dev Console");
					  
					   
					 
					 
				}	
			}
			if(baos!=null){
				if(!baos.toString().equals("")){
				DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
				Date date = new Date();
				textArea1.append("<"+dateFormat.format(date)+">"+baos.toString());
				baos.reset();
				}
			}
			
		}

	}