public static void main(String[] args) {
		String control;
		final boolean[] running = new boolean[1];
		running[0] = false;

		while (true) {

			getInputFromUser();

			new Thread(new Runnable() {

				public void run() {
					try {
						running[0] = true;
						input.setParameters(numberOfCalculations,
								numberOfThreads, calculationEachThread);
						piCalculator = PiCalculator.newInstance(workshop, input);
						piCalculator.calculate();
						piCalculator.showInfo();
						running[0] = false;
						printControlGuide();
					} catch (Exception e) {
						System.out.println("Error: " + e.getMessage());
					} finally {
						numberOfCalculations = null;
					}

				}
			}).start();

			printControlGuide();

			while (!(control = scanner.nextLine()).equals("n")) {
				if (control.equals("e")) {
					scanner.close();
					System.out.println("Exited Program");
					System.exit(0);
				}
				if (running[0]) {

					if (control.equals("s")) {
						piCalculator.stopCalculation();
					}
					if (control.equals("i")) {
						piCalculator.showInfo();
					}
				}
			}
			if (running[0]) {
				piCalculator.stopCalculation();
			}
		}

	}