public void run(){
        if(running == true)
            return;
        run = true;
        try {
		    while(run){
		    	running = true;
		        simulateOneStep();
		        running = false;
		        try {
		        Thread.sleep(50);
		    	} catch (InterruptedException ex) {}
		        synchronized (lock) {
		        	while(suspendFlag) {
		        		lock.wait();
		        	}
		        }
		    }
		} catch (InterruptedException e) {}
    }