@Override
	public int stepThrough() {

		if(ptr==0){
			if(isCompileClicked()){
				setCompileClicked(false);
				this.setViewToDefault();
			}
			else{
				refreshOutputs();
				this.setViewToDefault();
			}
			this.runner = new Runner(this.compiler);
		}
		else {
			this.runner = new Runner(this.compiler, this.sim40, this.errorStream, this.stdStream);
		}

		ptr = this.runner.stepthrough(ptr);
		
		if(this.runner.isProgramTerminated()) {
			this.controller.setButtonsEnabled(false);
		}


		this.sim40 = this.runner.getSimulator();
		this.errorStream = this.runner.getErrorStream();
		this.stdStream = this.runner.getStdStream();

		return this.sim40.lines[linePtr];
	}