public void executeTasks() {
		findNextCurrent();
		for(; time < maxTime + offset; time++) {
			if(currentIndex != -1) {
				if(--taskPool[currentIndex].burstTime == 0) {
					finished[currentIndex] = true;

					ganttTemp.endingTime = time + 1;
					ganttTemp.processID = "Process " + taskPool[currentIndex].getId();
					ganttChart.add(ganttTemp);
					System.out.println("Finished : " + ganttTemp);

					ganttTemp = new GanttChartHolder();
					System.out.println("Current Time : " + time);
					ganttTemp.beginningTime = time + 1;
					ganttUpdated = true;

					if(taskPool[currentIndex].deadlineTime >= time){
						System.out.println(taskPool[currentIndex] + " finished at time " + (time+1) + " within deadline : " + taskPool[currentIndex].deadlineTime);

						if(listener != null)
							listener.taskFinished(taskPool[currentIndex], burstTime[currentIndex], arrivalTime[currentIndex], (time+1), true);
					}
					else {
						System.out.println(taskPool[currentIndex] + " finished at time " + (time+1) + " exceeding deadline : " + taskPool[currentIndex].deadlineTime);

						if(listener != null)
							listener.taskFinished(taskPool[currentIndex], burstTime[currentIndex], arrivalTime[currentIndex], (time+1), false);
					}
					wt += (time - burstTime[currentIndex] - arrivalTime[currentIndex]);
					tat += (time - arrivalTime[currentIndex]);
					taskPool[currentIndex].burstTime = 65535;
					findNextCurrent();
				}
				else {
					if(taskPool[currentIndex].arrivalTime <= time)
						System.out.println("Time " + (time+1) + ": " + taskPool[currentIndex]);
					else {
						System.out.println("Time " + (time+1) + ": No task executed");
					}
				}
			}
			else {
				System.out.println("-1 as index at time " + (time+1));
			}

			currentIndex = searchNextExecutableTaskAtTime();
		}

		wt += taskPool.length;
		tat += taskPool.length;

		System.out.println("Waiting Time: " + wt);
		System.out.println("Average Waiting Time: " + (wt/taskPool.length));
		System.out.println("Turnaround Time: " + tat);
		System.out.println("Average Turnaround Time: " + (tat/taskPool.length));

		if(listener != null) {
			listener.AwtAndAtat(wt, wt/taskPool.length, tat, tat/taskPool.length);
			listener.ganttChartData(ganttChart);
		}

	}