public static synchronized void execute() {
		for (int id : tasks.keySet()) {
			ScheduledTask task = tasks.get(id);
			if (task.initialAt < task.initialDelay) {
				task.initialAt++;
			}
			else {
				if (task.repeat) {
					if (task.delayAt < task.tickDelay)
						task.delayAt++;
					else {
						try {
							task.task.run();
						}
						catch (Throwable e) {
							System.out.println("Error while executing repeating task: " + id);
						}
						task.delayAt = 0;
					}
				}
				else {
					try {
						task.task.run();
					}
					catch (Throwable e) {
						System.out.println("Error while executing task: " + id);
					}
					tasks.remove(id);
				}
			}
		}
	}